C# Class Testeroids.ContextSpecificationBase

Inheritance: IContextSpecification
Datei anzeigen Open project: Testeroids/Testeroids Class Usage Examples

Private Properties

Property Type Description
Act void
BaseSetUp void
BaseTestFixtureSetUp void
BaseTestFixtureTearDown void
ContextSpecificationBase System
DisposeContext void
EstablishContext void
GetNumberOfTestsInTestFixture int
IContextSpecification void
InstantiateMocks void
OutputContextTypeName void
PreTestFixtureSetUp void
RegisterTestFixtureWithAspects void

Protected Methods

Method Description
Because ( ) : void

The because method as overridable by the user of Testeroids. Will be called by Act.

Because will be injected through AOP on entering a test method. Internally, Act does make sure any verified mock created by the MockRepository has its recorded calls reset. This means that any call to a mocked method will "forget" about the method calls done prior to calling Because.

InitializeSubjectUnderTest ( ) : void

Performs additional initialization after the subject under test has been created.

RunPrerequisites ( ) : void

This will be called before the actual assert method. Executes all methods in the context marked with the PrerequisiteAttribute.

Private Methods

Method Description
Act ( ) : void

This will be called by the InstrumentTestsAspect aspect. Performs the "Act" part, or the logic which is to be tested.

BaseSetUp ( ) : void
BaseTestFixtureSetUp ( ) : void
BaseTestFixtureTearDown ( ) : void
ContextSpecificationBase ( ) : System

Initializes static members of the ContextSpecificationBase class.

DisposeContext ( ) : void
EstablishContext ( ) : void
GetNumberOfTestsInTestFixture ( ) : int

Calculates the number of tests (marked with TestAttribute) in this test fixture.

IContextSpecification ( MethodBase testMethodInfo, bool isExceptionResilient ) : void

This will be called by the InstrumentTestsAspect aspect. Rethrows any exception logged during the test run.

InstantiateMocks ( ) : void
OutputContextTypeName ( Type contextType ) : void
PreTestFixtureSetUp ( ) : void
RegisterTestFixtureWithAspects ( ) : void

Registers this context with each attribute derived from TestFixtureSetupAttributeBase. Those attributes will get invoked for setup and teardown notifications.

Method Details

Because() protected abstract method

The because method as overridable by the user of Testeroids. Will be called by Act.
Because will be injected through AOP on entering a test method. Internally, Act does make sure any verified mock created by the MockRepository has its recorded calls reset. This means that any call to a mocked method will "forget" about the method calls done prior to calling Because.
protected abstract Because ( ) : void
return void

InitializeSubjectUnderTest() protected abstract method

Performs additional initialization after the subject under test has been created.
protected abstract InitializeSubjectUnderTest ( ) : void
return void

RunPrerequisites() protected method

This will be called before the actual assert method. Executes all methods in the context marked with the PrerequisiteAttribute.
protected RunPrerequisites ( ) : void
return void