本文整理匯總了C#中System.TestClass.Should方法的典型用法代碼示例。如果您正苦於以下問題:C# TestClass.Should方法的具體用法?C# TestClass.Should怎麽用?C# TestClass.Should使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.TestClass
的用法示例。
在下文中一共展示了TestClass.Should方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CanDisposeWithUsings
public void CanDisposeWithUsings()
{
using(var myObject = new TestClass())
{
myObject.Should().NotBeNull();
}
}
示例2: IsDisposedIsFalseByDefault
public void IsDisposedIsFalseByDefault()
{
var myObject = new TestClass();
myObject.Should().NotBeNull();
myObject.IsDisposed.Should().BeFalse();
//Assert.False(myObject.IsDisposed);
}
示例3: DisposesManagedResources
public void DisposesManagedResources()
{
bool disposedManagedResources = false;
using(var myObject = new TestClass() {CalledWhenManagedResourcesDisposed = () => disposedManagedResources = true})
{
disposedManagedResources.Should().BeFalse();
myObject.Should().NotBeNull();
}
disposedManagedResources.Should().BeTrue();
}
示例4: IsDisposedReflectsState
public void IsDisposedReflectsState()
{
var myObject = new TestClass();
myObject.Should().NotBeNull();
myObject.IsDisposed.Should().BeFalse();
myObject.Dispose();
myObject.IsDisposed.Should().BeTrue();
}
示例5: CanDisposeExplictly
public void CanDisposeExplictly()
{
var myObject = new TestClass();
myObject.Should().NotBeNull();
myObject.Dispose();
}
示例6: IsDerivedFromAbstractDisposable
public void IsDerivedFromAbstractDisposable()
{
var myObject = new TestClass();
myObject.Should().NotBeNull();
myObject.Should().BeAssignableTo<AbstractDisposable>();
}
示例7: IsDerivedFromIDisposable2
public void IsDerivedFromIDisposable2()
{
var myObject = new TestClass();
myObject.Should().NotBeNull();
myObject.Should().BeAssignableTo<IDisposable2>();
}