C# Class Jwc.Experiment.Idioms.ObjectDisposalAssertion

Encapsulates a unit test that verifies that members throw ObjectDisposedException after its owner(object) is disposed.
Inheritance: IdiomaticAssertion
ファイルを表示 Open project: jwChung/Experimentalism Class Usage Examples

Public Methods

Method Description
ObjectDisposalAssertion ( ISpecimenBuilder builder ) : System

Initializes a new instance of the ObjectDisposalAssertion class.

Verify ( MethodInfo method ) : void

Verifies that a method throws ObjectDisposedException after its owner(object) is disposed.

Verify ( PropertyInfo property ) : void

Verifies that a property throws ObjectDisposedException after its owner(object) is disposed.

Private Methods

Method Description
GetArguments ( IEnumerable parameters ) : object[]
GetOwner ( MethodInfo method ) : IDisposable
ThrowDoesNotImplementIDisposable ( MethodInfo method ) : void
ThrowDoesNotThrowObjectDisposedException ( MethodInfo method ) : void
VerifyThrowsObjectDisposedException ( IDisposable owner, MethodInfo method ) : void

Method Details

ObjectDisposalAssertion() public method

Initializes a new instance of the ObjectDisposalAssertion class.
public ObjectDisposalAssertion ( ISpecimenBuilder builder ) : System
builder ISpecimenBuilder /// The builder to create an owner object. ///
return System

Verify() public method

Verifies that a method throws ObjectDisposedException after its owner(object) is disposed.
public Verify ( MethodInfo method ) : void
method System.Reflection.MethodInfo /// The method. ///
return void

Verify() public method

Verifies that a property throws ObjectDisposedException after its owner(object) is disposed.
public Verify ( PropertyInfo property ) : void
property System.Reflection.PropertyInfo /// The property. ///
return void