public static void Verify <TInput, TOutput>( TryGetAction1 <TInput> tryGetAction, string expected, string code ) where TInput : StatementSyntax where TOutput : StatementSyntax { Verify( tryGetAction.AsTransformer(), root => FindFixture <TInput>(root), root => FindFixture <TOutput>(root), expected, code ); }
public static StatementTransformer <TStatement> AsTransformer <TStatement>( this TryGetAction1 <TStatement> tryGetAction ) where TStatement : StatementSyntax { return((inputStatement, root, semanticModel) => { Func <SyntaxNode, SemanticModel, SyntaxNode> action; if (!tryGetAction(inputStatement, out action)) { return root; } return action(root, semanticModel); }); }
public static void VerifyDeclaration <TStatement>( TryGetAction1 <TStatement> tryGetAction, string expected, string code, string variableName = "r" ) where TStatement : StatementSyntax { Func <SyntaxNode, TStatement> findDeclaration = root => (TStatement)FindDeclaration(root, variableName); Verify( tryGetAction.AsTransformer(), findDeclaration, findDeclaration, expected, code ); }