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


C# Verify.ArgumentNullException方法代码示例

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


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

示例1: ExtendedObservableCollection_RemoveNullHandlerTest

 public void ExtendedObservableCollection_RemoveNullHandlerTest()
 {
     using (var verify = new Verify())
     {
         var list = new ObservableCollectionExtended<int>();
         var result = new ReadOnlyObservableCollectionExtended<int>(list);
         verify.ArgumentNullException("eventHandler", () => result.RemoveHandler((IListener<NotifyCollectionChangedEventArgs>)null));
         verify.ArgumentNullException("eventHandler", () => result.RemoveHandler((IListener<PropertyChangedEventArgs>)null));
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:10,代码来源:ExtendedReadOnlyObservableCollectionTests.cs

示例2: ExtendedObservableCollection_AddNullHandlerTest

        public void ExtendedObservableCollection_AddNullHandlerTest()
        {
            using (var verify = new Verify())
            {
                var result = new FooCollection();

                verify.ArgumentNullException("eventHandler", () => result.AddHandler((IListener<NotifyCollectionChangedEventArgs>)null));
                verify.ArgumentNullException("eventHandler", () => result.AddHandler((IListener<PropertyChangedEventArgs>)null));
                verify.ArgumentNullException("eventHandler", () => result.AddHandler((IListener<RelayedEventArgs<PropertyChangedEventArgs>>)null));
            }
        }
开发者ID:docevaad,项目名称:Anchor,代码行数:11,代码来源:ExtendedObservableCollectionTests.cs

示例3: WeakReferenceCollection_Add

 public void WeakReferenceCollection_Add()
 {
     using (var verify = new Verify())
     {
         var result = new WeakReferenceCollection<string>();
         verify.ArgumentNullException("item", () => result.Add(null));
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:8,代码来源:WeakReferenceCollectionTests.cs

示例4: CollectionUtilities_AddRange_Test2

 public void CollectionUtilities_AddRange_Test2()
 {
     using (var verify = new Verify())
     {
         List<string> target = null;
         List<string> list = null;
         verify.ArgumentNullException("target", () => CollectionUtilities.AddRange(target, list));
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:9,代码来源:CollectionUtilitiesTests.cs

示例5: WeakReferenceCollection_AddRange_Test1

 public void WeakReferenceCollection_AddRange_Test1()
 {
     using (var verify = new Verify())
     {
         IList<string> list = null;
         var result = new WeakReferenceCollection<string>();
         verify.ArgumentNullException("list", () => result.AddRange(list));
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:9,代码来源:WeakReferenceCollectionTests.cs

示例6: CollectionUtilities_RemoveRange_Test1

 public void CollectionUtilities_RemoveRange_Test1()
 {
     using (var verify = new Verify())
     {
         List<string> list = null;
         verify.ArgumentNullException("list", () => CollectionUtilities.RemoveRange(list, 0, 1));
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:8,代码来源:CollectionUtilitiesTests.cs

示例7: CollectionUtilities_InsertRange_Test1

 public void CollectionUtilities_InsertRange_Test1()
 {
     using (var verify = new Verify())
     {
         List<string> target = new List<string>();
         List<string> list = null;
         verify.ArgumentNullException("list", () => CollectionUtilities.InsertRange(target, 0, list));
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:9,代码来源:CollectionUtilitiesTests.cs

示例8: MetadataCache_Test2b

 public void MetadataCache_Test2b()
 {
     using (var verify = new Verify())
     {
         verify.ArgumentNullException("type", () => MetadataCache.GetMetadata((TypeInfo)null));
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:7,代码来源:MetadataCacheTests.cs

示例9: MetadataCache_Test17

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

示例10: WeakReferenceCollection_Remove_Test1

        public void WeakReferenceCollection_Remove_Test1()
        {
            using (var verify = new Verify())
            {
                string item1 = "AAA";
                string item2 = "BBB";

                var list = new List<string>();
                list.Add(item1);
                list.Add(item2);

                var result = new WeakReferenceCollection<string>();
                result.AddRange(list);
                verify.ItemsAreEqual(new[] { "AAA", "BBB" }, result, "Two items should have been in the collection.");

                verify.IsTrue(result.Remove(item2), "item 1 should have been removable");

                verify.ItemsAreEqual(new[] { "AAA" }, result, "One item should have been left in the collection.");

                verify.IsTrue(result.Remove(item1), "item 2 should have been removable");

                verify.IsEmpty(result, "Removal failed");

                verify.IsFalse(result.Remove(item1), "item was already removed");

                verify.ArgumentNullException("item", () => result.Remove(null));

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

示例11: WeakReferenceCollection_CopyTo_Test1

 public void WeakReferenceCollection_CopyTo_Test1()
 {
     using (var verify = new Verify())
     {
         var result = new WeakReferenceCollection<string>();
         verify.ArgumentNullException("array", () => result.CopyTo(null, 0));
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:8,代码来源:WeakReferenceCollectionTests.cs


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