C# Class NStub.CSharp.MbUnitRhinoMocks.CSharpMbUnitRhinoMocksCodeGenerator

The CSharpMbUnitRhinoMocksCodeGenerator is responsible for the generation of the individual class files with MbUnit and Rhino.Mocks support which will make up the actual test project. For information regarding the generation of the project file, see CSharpProjectGenerator"> and
Inheritance: NStub.CSharp.MbUnit.CSharpMbUnitCodeGenerator
Exibir arquivo Open project: Jedzia/NStub

Public Methods

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

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

Protected Methods

Method Description
ComposeTestSetupMockery ( ISetupAndTearDownCreationContext context, CodeMemberField testObjectMemberField, string testObjectName ) : IEnumerable

Compose additional items of the test setup method.

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

Generates the setup and tear down additional members and fields.

Private Methods

Method Description
AddMockObject ( CodeTypeMember mockRepositoryMemberField, string paraTypeFullName, string paraName ) : CodeAssignStatement
AddMockRepository ( CodeTypeDeclaration testClassDeclaration, CodeMemberMethod setUpMethod, string paraName ) : CodeMemberField

Adds the mock repository.

CreateMocker ( CodeTypeDeclaration testClassDeclaration, CodeMemberMethod setUpMethod, CodeMemberField mockRepositoryMemberField, List mockAssignments, Type paraType, string paraName, ConstructorAssignment data ) : void

Method Details

CSharpMbUnitRhinoMocksCodeGenerator() public method

Initializes a new instance of the CSharpMbUnitRhinoMocksCodeGenerator class based the given CodeNamespace which will output to the given directory.
or /// is null. is an /// empty string. /// cannot be found.
public CSharpMbUnitRhinoMocksCodeGenerator ( 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

ComposeTestSetupMockery() protected method

Compose additional items of the test setup method.
protected ComposeTestSetupMockery ( ISetupAndTearDownCreationContext context, CodeMemberField testObjectMemberField, string testObjectName ) : IEnumerable
context ISetupAndTearDownCreationContext The setup context.
testObjectMemberField System.CodeDom.CodeMemberField The member field of the object under test.
testObjectName string The name of the object under test.
return IEnumerable

GenerateSetupAndTearDownAdditional() protected method

Generates the setup and tear down additional members and fields.
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