C# Class NStub.CSharp.MbUnit.CSharpMbUnitCodeGenerator

The CSharpMbUnitCodeGenerator is responsible for the generation of the individual class files with MbUnit support which will make up the actual test project. For information regarding the generation of the project file, see .
Inheritance: BaseCSharpCodeGenerator, ICodeGenerator
Exibir arquivo Open project: Jedzia/NStub Class Usage Examples

Public Methods

Method Description
CSharpMbUnitCodeGenerator ( IBuildSystem buildSystem, CodeNamespace codeNamespace, IMemberBuilderFactory testBuilders, ICodeGeneratorParameters configuration ) : System

Initializes a new instance of the CSharpMbUnitCodeGenerator class based the given CodeNamespace which will output to the given directory.

Protected Methods

Method Description
ComposeTestTearDownMethod ( CodeMemberMethod teardownMethod, CodeMemberField testObjectMemberField, string testObjectName, Type testObjectType ) : void

Compose additional items of the test TearDown method.

GenerateAdditional ( ISetupAndTearDownCreationContext context, string testObjectName, CodeMemberField testObjectMemberField ) : void

Generates additional members of the test class.

GenerateSetupAndTearDownAdditional ( ISetupAndTearDownCreationContext context, string testObjectName, CodeMemberField testObjectMemberField ) : void

Generates the setup and tear down additional members and fields.

Override this to customize the behavior of the generator.

RetrieveNamespaceImports ( ) : IEnumerable

Add namespace imports to the main compilation unit.

Method Details

CSharpMbUnitCodeGenerator() public method

Initializes a new instance of the CSharpMbUnitCodeGenerator class based the given CodeNamespace which will output to the given directory.
or /// is null. is an /// empty string. /// cannot be found.
public CSharpMbUnitCodeGenerator ( IBuildSystem buildSystem, CodeNamespace codeNamespace, IMemberBuilderFactory testBuilders, ICodeGeneratorParameters configuration ) : System
buildSystem IBuildSystem The build system.
codeNamespace System.CodeDom.CodeNamespace The code namespace.
testBuilders IMemberBuilderFactory The test builder repository.
configuration ICodeGeneratorParameters The configuration of the generator.
return System

ComposeTestTearDownMethod() protected method

Compose additional items of the test TearDown method.
protected ComposeTestTearDownMethod ( CodeMemberMethod teardownMethod, CodeMemberField testObjectMemberField, string testObjectName, Type testObjectType ) : void
teardownMethod System.CodeDom.CodeMemberMethod A reference to the TearDown method of the test.
testObjectMemberField System.CodeDom.CodeMemberField The member field of the object under test.
testObjectName string The name of the object under test.
testObjectType System.Type Type of the object under test(OuT).
return void

GenerateAdditional() protected method

Generates additional members of the test class.
protected GenerateAdditional ( ISetupAndTearDownCreationContext context, string testObjectName, CodeMemberField testObjectMemberField ) : void
context ISetupAndTearDownCreationContext Contains data specific to SetUp and TearDown test-method generation.
testObjectName string The name of the object under test.
testObjectMemberField System.CodeDom.CodeMemberField The member field of the object under test.
return void

GenerateSetupAndTearDownAdditional() protected method

Generates the setup and tear down additional members and fields.
Override this to customize the behavior of the generator.
protected GenerateSetupAndTearDownAdditional ( ISetupAndTearDownCreationContext context, string testObjectName, CodeMemberField testObjectMemberField ) : void
context ISetupAndTearDownCreationContext Contains data specific to SetUp and TearDown test-method generation.
testObjectName string Name of the test object.
testObjectMemberField System.CodeDom.CodeMemberField The test object member field.
return void

RetrieveNamespaceImports() protected method

Add namespace imports to the main compilation unit.
protected RetrieveNamespaceImports ( ) : IEnumerable
return IEnumerable