本文整理汇总了C#中Verify.Fail方法的典型用法代码示例。如果您正苦于以下问题:C# Verify.Fail方法的具体用法?C# Verify.Fail怎么用?C# Verify.Fail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Verify
的用法示例。
在下文中一共展示了Verify.Fail方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RelayedEventArgs_Test1
public void RelayedEventArgs_Test1()
{
using (var verify = new Verify())
{
try
{
var e = RelayedEventArgs.Create(new object(), (EventArgs)null);
verify.Fail("Expected an ArgumentNullException");
}
catch (ArgumentNullException ex)
{
verify.AreEqual("eventArgs", ex.ParamName, "Parameter name is wrong");
}
}
}
示例2: ExtendedObservableCollection_AddRange_Test2
public void ExtendedObservableCollection_AddRange_Test2()
{
using (var verify = new Verify())
{
try
{
var result = new ObservableCollectionExtended<object>();
result.AddRange(null);
verify.Fail("Expected an ArgumentNullException exception");
}
catch (ArgumentNullException ex)
{
verify.AreEqual("list", ex.ParamName, "Parameter name is incorrect");
}
}
}
示例3: PropertyMetadataCollection_CopyTo_Test1
public void PropertyMetadataCollection_CopyTo_Test1()
{
using (var verify = new Verify())
{
try
{
var result = MetadataCache.GetMetadata(typeof(Tests.Metadata.Mock)).Properties;
result.CopyTo(null, 0);
verify.Fail("Expected an ArgumentNullException");
}
catch (ArgumentNullException ex)
{
verify.AreEqual("array", ex.ParamName, "Incorrect parameter name");
}
}
}
示例4: MetadataCache_Test5
public void MetadataCache_Test5()
{
using (var verify = new Verify())
{
try
{
MetadataCache.GetMetadata(typeof(BadMock));
verify.Fail("This should have thrown an exception because of the unmatched calculated field.");
}
catch (InvalidOperationException)
{
}
}
}
示例5: ExtendedReadOnlyObservableCollection_Constructor_Test1
public void ExtendedReadOnlyObservableCollection_Constructor_Test1()
{
using (var verify = new Verify())
{
try
{
ObservableCollectionExtended<int> list = null;
var result = new ReadOnlyObservableCollectionExtended<int>(list);
verify.Fail("Expected an ArgumentNullException");
}
catch (ArgumentNullException ex)
{
verify.AreEqual("list", ex.ParamName, "Parameter name is wrong");
}
}
}