本文整理汇总了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>();
}