C# Class NStub.Core.TestProjectBuilder

Builds the test files.
Afficher le fichier Open project: Jedzia/NStub Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

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

Writes the test file.

Method Details

GenerateTests() public méthode

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

GenerateTests() public méthode

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.
Résultat void

OnCreateCodeGenerator() protected méthode

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.
Résultat ICodeGenerator

TestProjectBuilder() public méthode

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.
Résultat System