VS 2012中的SQLProj代码覆盖率

时间:2013-08-30 20:23:48

标签: unit-testing visual-studio-2012 code-coverage sqlproj

在Visual Studio 2012中,我有一个.SQLProj来控制我们的SP和函数。我们有一个单元测试项目,测试方法如下图所示。单元测试成功连接到我们的CI服务器。我的问题是,我们如何为该项目生成单元测试代码覆盖率指标?

[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);
    }

0 个答案:

没有答案