C# Class NStub.CSharp.ObjectGeneration.TestObjectComposerBase

Base class for a ITestObjectComposer test-class member field generator.
Inheritance: ITestObjectComposer
Exibir arquivo Open project: Jedzia/NStub

Private Properties

Property Type Description

Public Methods

Method Description
AssignExtra ( CodeTypeDeclaration testClassDeclaration, CodeMemberMethod testMethod, CodeObjectCreateExpression testObjectConstructor, AssignmentInfoCollection ctorAssignments ) : void

Assigns the parameters detected with BuildTestObject to an explicitly specified constructor create expression to a specified method and creates field initialization expressions for each parameter.

AssignOnly ( CodeTypeDeclaration testClassDeclaration, CodeMemberMethod testMethod, CodeObjectCreateExpression testObjectConstructor, AssignmentInfoCollection ctorAssignments ) : void

Assigns the parameters detected with BuildTestObject to an explicitly specified constructor create expression without initializing extra fields like in AssignExtra.

AssignParameters ( CodeTypeDeclaration testClassDeclaration ) : void

Assigns the parameters detected with BuildTestObject to the constructor create expression stored in TestObjectMemberFieldCreateExpression.

Simply means, to add the calculated fields to the specified testClassDeclaration.

AssignParameters ( CodeTypeDeclaration testClassDeclaration, CodeObjectCreateExpression testObjectConstructor ) : void

Assigns the parameters detected with BuildTestObject to the specified constructor create expression.

BuildTestObject ( MemberVisibility visibility ) : CodeObjectCreateExpression

Creates a code generation expression for an object to test with a member field and initialization in the previous specified SetUpMethod method.

Protected Methods

Method Description
AddAssignStatement ( CodeAssignStatement assignStatement ) : void

Add a assign statement to the test object initializer method.

TestObjectComposerBase ( BuildDataDictionary buildData, CodeMemberMethod setUpMethod, CodeMemberField testObjectMemberField, string testObjectName, Type testObjectType ) : System

Initializes a new instance of the TestObjectComposerBase class.

Method Details

AddAssignStatement() protected method

Add a assign statement to the test object initializer method.
protected AddAssignStatement ( CodeAssignStatement assignStatement ) : void
assignStatement System.CodeDom.CodeAssignStatement The code assign statement.
return void

AssignExtra() public abstract method

Assigns the parameters detected with BuildTestObject to an explicitly specified constructor create expression to a specified method and creates field initialization expressions for each parameter.
public abstract AssignExtra ( CodeTypeDeclaration testClassDeclaration, CodeMemberMethod testMethod, CodeObjectCreateExpression testObjectConstructor, AssignmentInfoCollection ctorAssignments ) : void
testClassDeclaration System.CodeDom.CodeTypeDeclaration The test class declaration.
testMethod System.CodeDom.CodeMemberMethod The test method, to add the assign-statements to.
testObjectConstructor System.CodeDom.CodeObjectCreateExpression The object constructor to create the parameter initializers for.
ctorAssignments AssignmentInfoCollection The list of constructor assignments that specify the parameter to add.
return void

AssignOnly() public abstract method

Assigns the parameters detected with BuildTestObject to an explicitly specified constructor create expression without initializing extra fields like in AssignExtra.
public abstract AssignOnly ( CodeTypeDeclaration testClassDeclaration, CodeMemberMethod testMethod, CodeObjectCreateExpression testObjectConstructor, AssignmentInfoCollection ctorAssignments ) : void
testClassDeclaration System.CodeDom.CodeTypeDeclaration The test class declaration.
testMethod System.CodeDom.CodeMemberMethod The test method, to add the assign-statements to.
testObjectConstructor System.CodeDom.CodeObjectCreateExpression The object constructor to create the parameter initializers for.
ctorAssignments AssignmentInfoCollection The list of constructor assignments that specify the parameter to add.
return void

AssignParameters() public method

Assigns the parameters detected with BuildTestObject to the constructor create expression stored in TestObjectMemberFieldCreateExpression.
Simply means, to add the calculated fields to the specified testClassDeclaration.
public AssignParameters ( CodeTypeDeclaration testClassDeclaration ) : void
testClassDeclaration System.CodeDom.CodeTypeDeclaration The test class declaration.
return void

AssignParameters() public abstract method

Assigns the parameters detected with BuildTestObject to the specified constructor create expression.
public abstract AssignParameters ( CodeTypeDeclaration testClassDeclaration, CodeObjectCreateExpression testObjectConstructor ) : void
testClassDeclaration System.CodeDom.CodeTypeDeclaration The test class declaration.
testObjectConstructor System.CodeDom.CodeObjectCreateExpression The object constructor to create the parameter initializers for.
return void

BuildTestObject() public abstract method

Creates a code generation expression for an object to test with a member field and initialization in the previous specified SetUpMethod method.
public abstract BuildTestObject ( MemberVisibility visibility ) : CodeObjectCreateExpression
visibility MemberVisibility The visibility level of the objects to parse. Default should be public.
return System.CodeDom.CodeObjectCreateExpression

TestObjectComposerBase() protected method

Initializes a new instance of the TestObjectComposerBase class.
protected TestObjectComposerBase ( BuildDataDictionary buildData, CodeMemberMethod setUpMethod, CodeMemberField testObjectMemberField, string testObjectName, Type testObjectType ) : System
buildData BuildDataDictionary The build data dictionary.
setUpMethod System.CodeDom.CodeMemberMethod The method where the test object is initialized
testObjectMemberField System.CodeDom.CodeMemberField The member field creation expression for the object under test.
testObjectName string The name of the test object.
testObjectType System.Type Type of the test object.
return System