C# Class NStub.Core.TestProjectBuilder

Builds the test files.
Mostra file Open project: Jedzia/NStub Class Usage Examples

Public Methods

Method Description
GenerateTests ( GeneratorRunnerData data ) : void

Generates the tests.

GenerateTests ( string outputFolder, Type generatorType, string inputAssemblyPath, IList mainNodes, IList referencedAssemblies ) : void

Creates a list of the methods for which the user wishes to generate test cases for and instantiates an instance of NStub around these methods. The sources are files are then generated.

TestProjectBuilder ( IBuildSystem sbs, IProjectGenerator projectGenerator, Func createGeneratorCallback, Action logger ) : System

Initializes a new instance of the TestProjectBuilder class.

Protected Methods

Method Description
OnCreateCodeGenerator ( CodeNamespace codeNamespace, ICodeGeneratorParameters configuration, IBuildSystem buildSystem ) : ICodeGenerator

Called when the TestProjectBuilder is about to create the code generator.

Override this method to instantiate others than the standard generators. The default implementation is:

Private Methods

Method Description
CreateMethod ( string methodName, MethodInfo methodInfo ) : CodeMemberMethod
WriteTestFile ( string calculatedOutputDirectory, CodeNamespace codeNamespace ) : void

Writes the test file.

Method Details

GenerateTests() public method

Generates the tests.
public GenerateTests ( GeneratorRunnerData data ) : void
data GeneratorRunnerData The data that is necessary for test building.
return void

GenerateTests() public method

Creates a list of the methods for which the user wishes to generate test cases for and instantiates an instance of NStub around these methods. The sources are files are then generated.
public GenerateTests ( string outputFolder, Type generatorType, string inputAssemblyPath, IList mainNodes, IList referencedAssemblies ) : void
outputFolder string The output folder.
generatorType System.Type Type of the code generator to use.
inputAssemblyPath string The input assembly path.
mainNodes IList The main nodes.
referencedAssemblies IList The list of referenced assemblies.
return void

OnCreateCodeGenerator() protected method

Called when the TestProjectBuilder is about to create the code generator.
Override this method to instantiate others than the standard generators. The default implementation is:
protected OnCreateCodeGenerator ( CodeNamespace codeNamespace, ICodeGeneratorParameters configuration, IBuildSystem buildSystem ) : ICodeGenerator
codeNamespace System.CodeDom.CodeNamespace The code namespace.
configuration ICodeGeneratorParameters The configuration.
buildSystem IBuildSystem The build system.
return ICodeGenerator

TestProjectBuilder() public method

Initializes a new instance of the TestProjectBuilder class.
public TestProjectBuilder ( IBuildSystem sbs, IProjectGenerator projectGenerator, Func createGeneratorCallback, Action logger ) : System
sbs IBuildSystem The system wide build system.
projectGenerator IProjectGenerator The project generator.
createGeneratorCallback Func The callback to create new code /// generators per test class .
logger Action The logging method.
return System