1

In Visual Studio 2012 I have a .SQLProj to control our SPs and functions. We have a Unit Testing project with test methods as illustrated below. The Unit Tests are wired into our CI server successfully. My question is, how can we go about generating unit test code coverage metrics for this project?

[TestMethod()]
    public void dbo_spGetSPFooterSectionTest()
    {
        SqlDatabaseTestActions testActions = this.dbo_spGetSPFooterSectionTestData;
        // Execute the pre-test script
        // 
        System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "Executing pre-test script...");
        SqlExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction);
        // Execute the test script
        // 
        System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "Executing test script...");
        SqlExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction);
        // Execute the post-test script
        // 
        System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "Executing post-test script...");
        SqlExecutionResult[] posttestResults =      TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction);
    }
4

0 回答 0