本文整理汇总了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");
}
}
示例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");
}
}
示例3: CalculatedFieldAttribute_Test3
public void CalculatedFieldAttribute_Test3()
{
using (var verify = new Verify())
{
verify.ArgumentException("sources", () => new CalculatedFieldAttribute(null), "empty lists are not allowed");
}
}
示例4: CalculatedFieldAttribute_Test2
public void CalculatedFieldAttribute_Test2()
{
using (var verify = new Verify())
{
verify.ArgumentException("sources", () => new CalculatedFieldAttribute(null));
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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));
}
}
示例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");
}
}
示例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));
}
}
示例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");
}
}
示例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");
}
}