当前位置: 首页>>代码示例>>C#>>正文


C# Verify.ArgumentException方法代码示例

本文整理汇总了C#中Verify.ArgumentException方法的典型用法代码示例。如果您正苦于以下问题:C# Verify.ArgumentException方法的具体用法?C# Verify.ArgumentException怎么用?C# Verify.ArgumentException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Verify的用法示例。


在下文中一共展示了Verify.ArgumentException方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CollectionUtilities_AddRange_Test11

 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");
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:10,代码来源:CollectionUtilitiesTests.cs

示例2: CollectionUtilities_AddRange_Test10

 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");
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:10,代码来源:CollectionUtilitiesTests.cs

示例3: CalculatedFieldAttribute_Test3

 public void CalculatedFieldAttribute_Test3()
 {
     using (var verify = new Verify())
     {
         verify.ArgumentException("sources", () => new CalculatedFieldAttribute(null), "empty lists are not allowed");
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:7,代码来源:CalculatedFieldAttributeTests.cs

示例4: CalculatedFieldAttribute_Test2

        public void CalculatedFieldAttribute_Test2()
        {
            using (var verify = new Verify())
            {
                verify.ArgumentException("sources", () => new CalculatedFieldAttribute(null));

            }
        }
开发者ID:docevaad,项目名称:Anchor,代码行数:8,代码来源:CalculatedFieldAttributeTests.cs

示例5: WeakReferenceCollection_AddRange_Test3

        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");
            }
        }
开发者ID:docevaad,项目名称:Anchor,代码行数:15,代码来源:WeakReferenceCollectionTests.cs

示例6: CollectionUtilities_RemoveRange_Test7

 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");
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:8,代码来源:CollectionUtilitiesTests.cs

示例7: CollectionUtilities_InsertRange_Test8

 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");
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:9,代码来源:CollectionUtilitiesTests.cs

示例8: MetadataCache_Test28

 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));
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:9,代码来源:MetadataCacheTests.cs

示例9: MetadataCache_Test27

 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");
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:9,代码来源:MetadataCacheTests.cs

示例10: MetadataCache_Test18

 public void MetadataCache_Test18()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(Mock));
         verify.ArgumentException("propertyName", () => result.Properties.Contains((string)null));
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:8,代码来源:MetadataCacheTests.cs

示例11: MetadataCache_Test13

 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");
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:11,代码来源:MetadataCacheTests.cs

示例12: WeakReferenceCollection_CopyTo_Test2

 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");
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:10,代码来源:WeakReferenceCollectionTests.cs


注:本文中的Verify.ArgumentException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。