SqlUnitTesting_VS2013配置文件的文档

时间:2014-04-07 13:59:52

标签: unit-testing visual-studio-2013 sql-server-data-tools

是否有人知道在Visual Studio 2013中哪里可以找到app.config部分的数据库单元测试文档?

即。以下文件:

<section name="SqlUnitTesting_VS2013" type="Microsoft.Data.Tools.Schema.Sql.UnitTesting.Configuration.SqlUnitTestingSection, Microsoft.Data.Tools.Schema.Sql.UnitTesting, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

1 个答案:

答案 0 :(得分:1)

我不知道有关这些配置属性的文档在哪里。在这里查看我的问题SSDT Unit Test:. An error occurred while SQL Server unit testing settings were being read from the configuration file

我想出了我自己的app.config(经过大量的研究和尝试&误差)并且它正在运行。您的数据库项目需要部署才能运行测试。

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="system.data.localdb" type="System.Data.LocalDBConfigurationSection,System.Data,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089"/>
    <section name="SqlUnitTesting_VS2013" type="Microsoft.Data.Tools.Schema.Sql.UnitTesting.Configuration.SqlUnitTestingSection, Microsoft.Data.Tools.Schema.Sql.UnitTesting, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </configSections>
  <system.data.localdb>
    <localdbinstances>
      <add name="(localdb)\ProjectsV12" version="12.0" />
    </localdbinstances>
  </system.data.localdb>
  <SqlUnitTesting_VS2013>
    <DatabaseDeployment DatabaseProjectFileName="..\..\..\Database_Project_Name\Database_Project_Name.sqlproj"
        Configuration="Debug" />
    <DataGeneration ClearDatabase="true" />
    <ExecutionContext Provider="System.Data.SqlClient" ConnectionString="Data Source=(localdb)\ProjectsV12;Initial Catalog=Database_Name;Integrated Security=True;Pooling=False;Connect Timeout=30"
        CommandTimeout="30" />
    <PrivilegedContext Provider="System.Data.SqlClient" ConnectionString="Data Source=(localdb)\ProjectsV12;Initial Catalog=Database_Name;Integrated Security=True;Pooling=False;Connect Timeout=30"
        CommandTimeout="30" />
  </SqlUnitTesting_VS2013>
</configuration>