public void Test_INTEGRATION_SINGLE_FILE_PIPELINE_HOOK_TEST() { HookInjectionPipeline pipeline = new HookInjectionPipeline(); string outText = pipeline.AddHooksToSourceFile(sourceFile); Assert.IsTrue(outText.Contains("OnMethodEnter")); Assert.IsTrue(outText.Contains("using CodeRecordHelpers;")); File.WriteAllText("/tmp/code.cs", outText); }
private void RunEndToEndHookInjection(TestCase testCase) { var fname = testCase.FileName; var contents = testCase.Code; HookInjectionPipeline pipeline = new HookInjectionPipeline(); string newContents = pipeline.AddHooksToSourceFile(fname, contents); var methoNode = Helpers.GetFirstNodeOfType <MethodDeclarationSyntax>(newContents); Helpers.CheckExpectedStatements(testCase.ExpectedStatementCount, testCase.ExpectedStatements, methoNode.Body); }