C# Class NStub.CSharp.CSharpCodeGenerator

The CSharpCodeGenerator is responsible for the generation of the individual class files which will make up the actual test project. For information regarding the generation of the project file, see CSharpProjectGenerator.
Inheritance: NStub.Core.ICodeGenerator
Exibir arquivo Open project: Jedzia/NStub

Public Methods

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

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

GenerateCode ( ) : void

This methods actually performs the code generation for the file current System.CodeDom.CodeNamespace. All classes within the namespace will have exactly one file generated for them.

Private Methods

Method Description
CreateStubForCodeMemberMethod ( CodeMemberMethod codeMemberMethod ) : void

Creates the stub for the code member method. This method actually implements the method body for the test method.

RemoveDuplicatedMembers ( CodeTypeDeclaration codeTypeDeclaration ) : void

Since types can contain multiple overloads of the same method, once we remove the parameters from every method our type may have the many duplicates of the same method. This method removes those duplicates.

WriteClassFile ( string className, CodeNamespace codenamespace ) : void

Writes the class file. This method actually creates the physical class file and populates it accordingly.

Method Details

CSharpCodeGenerator() public method

Initializes a new instance of the CSharpCodeGenerator class based the given CodeNamespace which will output to the given directory.
or /// outputDirectory is . outputDirectory is an /// empty string. outputDirectory /// cannot be found. ApplicationException Directory Cannot Be Found.
public CSharpCodeGenerator ( 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 builders.
configuration ICodeGeneratorParameters The configuration.
return System

GenerateCode() public method

This methods actually performs the code generation for the file current System.CodeDom.CodeNamespace. All classes within the namespace will have exactly one file generated for them.
public GenerateCode ( ) : void
return void