private static MethodDeclarationSyntax GenerateCreateSut( ClassDeclarationSyntax classDeclaration, MethodInspector constructorInspector) { var methodBuilder = new MethodBuilder(GH.IdentifierToken("CreateSut")) .Modifiers(Modifiers.Private); var constructorParameters = constructorInspector .Parameters .Select(p => SF.Argument( EGH.MemberAccess( EGH.ThisMemberAccess( GH.Identifier(MockName(p.Name)) ), GH.Identifier("Object") ) ) ); methodBuilder.ArrowBody( EGH.Arrow( EGH.CreateObject( SF.IdentifierName(classDeclaration.Identifier), constructorParameters.ToArray()))); return(methodBuilder.Build()); }
public BodyBuilder AddFieldAssignment( IdentifierNameSyntax fieldName, ExpressionSyntax rightSide) { // TODO: configurable this ? AddAssignment( EGH.ThisMemberAccess(fieldName), rightSide); return(this); }