本文整理汇总了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));
}
}
示例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));
}
}
示例3: WeakReferenceCollection_Add
public void WeakReferenceCollection_Add()
{
using (var verify = new Verify())
{
var result = new WeakReferenceCollection<string>();
verify.ArgumentNullException("item", () => result.Add(null));
}
}
示例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));
}
}
示例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));
}
}
示例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));
}
}
示例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));
}
}
示例8: MetadataCache_Test2b
public void MetadataCache_Test2b()
{
using (var verify = new Verify())
{
verify.ArgumentNullException("type", () => MetadataCache.GetMetadata((TypeInfo)null));
}
}
示例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));
}
}
示例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));
}
}
示例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));
}
}