Пример #1
0
 public void CollectionUtilities_AddRange_Test10()
 {
     using (var verify = new Verify())
     {
         IEnumerable<int> list = new List<int> { 1, 2, 3 };
         ICollection<int> target = new ReadOnlyCollection<int>(new List<int>());
         verify.ArgumentException("target", () => CollectionUtilities.AddRange(target, list), "read-only list");
         verify.ArgumentException("target", () => CollectionUtilities.AddRange(target, 1, 2, 3), "read-only list");
     }
 }
Пример #2
0
 public void CollectionUtilities_AddRange_Test11()
 {
     using (var verify = new Verify())
     {
         var list = (new List<int> { 1, 2, 3 }).Where(x => true);
         ICollection<int> target = new ReadOnlyCollection<int>(new List<int>());
         verify.ArgumentException("target", () => CollectionUtilities.AddRange(target, list), "read-only list");
         verify.ArgumentException("target", () => CollectionUtilities.AddRange(target, 1, 2, 3), "read-only list");
     }
 }
Пример #3
0
 public void CollectionUtilities_AddRange_Test11()
 {
     using (var verify = new Verify())
     {
         var list = (new List <int> {
             1, 2, 3
         }).Where(x => true);
         ICollection <int> target = new ReadOnlyCollection <int>(new List <int>());
         verify.ArgumentException("target", () => CollectionUtilities.AddRange(target, list), "read-only list");
         verify.ArgumentException("target", () => CollectionUtilities.AddRange(target, 1, 2, 3), "read-only list");
     }
 }
Пример #4
0
 public void CollectionUtilities_AddRange_Test10()
 {
     using (var verify = new Verify())
     {
         IEnumerable <int> list = new List <int> {
             1, 2, 3
         };
         ICollection <int> target = new ReadOnlyCollection <int>(new List <int>());
         verify.ArgumentException("target", () => CollectionUtilities.AddRange(target, list), "read-only list");
         verify.ArgumentException("target", () => CollectionUtilities.AddRange(target, 1, 2, 3), "read-only list");
     }
 }
Пример #5
0
 public void CalculatedFieldAttribute_Test3()
 {
     using (var verify = new Verify())
     {
         verify.ArgumentException("sources", () => new CalculatedFieldAttribute(null), "empty lists are not allowed");
     }
 }
Пример #6
0
 public void CalculatedFieldAttribute_Test2()
 {
     using (var verify = new Verify())
     {
         verify.ArgumentException("sources", () => new CalculatedFieldAttribute(null));
     }
 }
 public void CalculatedFieldAttribute_Test3()
 {
     using (var verify = new Verify())
     {
         verify.ArgumentException("sources", () => new CalculatedFieldAttribute(null), "empty lists are not allowed");
     }
 }
Пример #8
0
 public void MetadataCache_Test27()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(Mock));
         verify.ArgumentException("propertyName", () => result.Properties.TryGetValue("", out PropertyMetadata p), "can't use empty strings for property name");
     }
 }
        public void CalculatedFieldAttribute_Test2()
        {
            using (var verify = new Verify())
            {
                verify.ArgumentException("sources", () => new CalculatedFieldAttribute(null));

            }
        }
Пример #10
0
 public void MetadataCache_Test18()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(Mock));
         verify.ArgumentException("propertyName", () => result.Properties.Contains((string)null));
     }
 }
Пример #11
0
 public void MetadataCache_Test28()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(Mock));
         verify.ArgumentException("propertyName", () => result.Properties.TryGetValue(null, out PropertyMetadata p));
     }
 }
Пример #12
0
 public void WeakReferenceCollection_CopyTo_Test2()
 {
     using (var verify = new Verify())
     {
         var result = new WeakReferenceCollection <string>();
         result.Add("");
         var array = new string[0];
         verify.ArgumentException("array", () => result.CopyTo(array, 0), "array is too small");
     }
 }
Пример #13
0
 public void CollectionUtilities_RemoveRange_Test7()
 {
     using (var verify = new Verify())
     {
         IList <int> target = new ReadOnlyCollection <int>(new List <int> {
             4, 5, 6
         });
         verify.ArgumentException("list", () => CollectionUtilities.RemoveRange(target, 1, 1), "read-only list");
     }
 }
Пример #14
0
 public void MetadataCache_Test13()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(Mock));
         verify.ArgumentException("propertyName", () =>
         {
             var x = result.Properties[null];
         }, "empty strings are not allowed");
     }
 }
Пример #15
0
 public void CollectionUtilities_InsertRange_Test8()
 {
     using (var verify = new Verify())
     {
         var list = new List <int> {
             1, 2, 3
         };
         IList <int> target = new ReadOnlyCollection <int>(new List <int> {
             4, 5, 6
         });
         verify.ArgumentException("target", () => CollectionUtilities.InsertRange(target, 1, list), "read-only list");
     }
 }
        public void WeakReferenceCollection_AddRange_Test3()
        {
            using (var verify = new Verify())
            {
                string item1 = "AAA";
                string item2 = "BBB";

                var list = new List<string>();
                list.Add(item1);
                list.Add(null);
                list.Add(item2);
                var result = new WeakReferenceCollection<string>();
                verify.ArgumentException("list", () => result.AddRange(list), "The list contains a null item");
            }
        }
Пример #17
0
        public void WeakReferenceCollection_AddRange_Test3()
        {
            using (var verify = new Verify())
            {
                string item1 = "AAA";
                string item2 = "BBB";

                var list = new List <string>();
                list.Add(item1);
                list.Add(null);
                list.Add(item2);
                var result = new WeakReferenceCollection <string>();
                verify.ArgumentException("list", () => result.AddRange(list), "The list contains a null item");
            }
        }
 public void WeakReferenceCollection_CopyTo_Test2()
 {
     using (var verify = new Verify())
     {
         var result = new WeakReferenceCollection<string>();
         result.Add("");
         var array = new string[0];
         verify.ArgumentException("array", () => result.CopyTo(array, 0), "array is too small");
     }
 }
Пример #19
0
 public void MetadataCache_Test18()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(Mock));
         verify.ArgumentException("propertyName", () => result.Properties.Contains((string)null));
     }
 }
Пример #20
0
 public void MetadataCache_Test27()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(Mock));
         PropertyMetadata p;
         verify.ArgumentException("propertyName", () => result.Properties.TryGetValue("", out p), "can't use empty strings for property name");
     }
 }
Пример #21
0
 public void MetadataCache_Test28()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(Mock));
         PropertyMetadata p;
         verify.ArgumentException("propertyName", () => result.Properties.TryGetValue(null, out p));
     }
 }
Пример #22
0
 public void CollectionUtilities_RemoveRange_Test7()
 {
     using (var verify = new Verify())
     {
         IList<int> target = new ReadOnlyCollection<int>(new List<int> { 4, 5, 6 });
         verify.ArgumentException("list", () => CollectionUtilities.RemoveRange(target, 1, 1), "read-only list");
     }
 }
Пример #23
0
 public void CollectionUtilities_InsertRange_Test8()
 {
     using (var verify = new Verify())
     {
         var list = new List<int> { 1, 2, 3 };
         IList<int> target = new ReadOnlyCollection<int>(new List<int> { 4, 5, 6 });
         verify.ArgumentException("target", () => CollectionUtilities.InsertRange(target, 1, list), "read-only list");
     }
 }
Пример #24
0
 public void MetadataCache_Test13()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(Mock));
         verify.ArgumentException("propertyName", () =>
         {
             var x = result.Properties[null];
         }, "empty strings are not allowed");
     }
 }