Skip to content

Commit

Permalink
Merge pull request #24 from martincostello/sql-server-2016
Browse files Browse the repository at this point in the history
Support SQL Server LocalDB 2016
  • Loading branch information
martincostello committed Jun 1, 2016
2 parents 1a25b59 + 9c672cd commit a5b02df
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SQL LocalDB Wrapper is a .NET 3.5 assembly providing interop with the [Microsoft

It is designed to support use of dependency injection by consumers by implementing interfaces, and is also designed to fit with the other data access providers defined under the System.Data namespaces.

The assembly supports using SQL Server LocalDB 2012 and 2014 for both the x86 and x64 platforms.
The assembly supports using SQL Server LocalDB 2012 and 2014 for both the x86 and x64 platforms and SQL Server LocalDB 2016 for the x64 platform.

## Downloads

Expand Down
5 changes: 3 additions & 2 deletions src/SqlLocalDb.UnitTests/ExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,9 @@ public void Extensions_GetOrCreateInstance_For_2012_Default_Instance_Name()

[TestMethod]
[TestCategory(TestCategories.SqlServer2014)]
[Description("Tests GetOrCreateInstance() if instanceName is the SQL LocalDB 2014 default instance name.")]
public void Extensions_GetOrCreateInstance_For_2014_Default_Instance_Name()
[TestCategory(TestCategories.SqlServer2016)]
[Description("Tests GetOrCreateInstance() if instanceName is the SQL LocalDB 2014 and 2016 default instance name.")]
public void Extensions_GetOrCreateInstance_For_2014_And_2016_Default_Instance_Name()
{
// Arrange
ISqlLocalDbProvider value = new SqlLocalDbProvider();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="SQLLocalDB:OverrideVersion" value="13.0" />
</appSettings>
</configuration>
20 changes: 20 additions & 0 deletions src/SqlLocalDb.UnitTests/SqlLocalDbApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,7 @@ public void SqlLocalDbApi_Uses_User_Values_If_Configuration_Section_Defined_And_
[TestMethod]
[TestCategory(TestCategories.SqlServer2012)]
[TestCategory(TestCategories.SqlServer2014)]
[TestCategory(TestCategories.SqlServer2016)]
[Description("Tests that the DefaultInstanceName property returns the correct value.")]
public void SqlLocalDbApi_DefaultInstanceName_Returns_Correct_Value()
{
Expand Down Expand Up @@ -1447,6 +1448,25 @@ public void SqlLocalDbApi_DefaultInstanceName_Returns_Correct_Value_2014()
configurationFile: "SqlLocalDbApiTests.DefaultInstanceName.2014.config");
}

[Ignore] // Not yet installed in AppVeyor CI
[TestMethod]
[TestCategory(TestCategories.SqlServer2016)]
[Description("Tests that the DefaultInstanceName property returns the correct value for SQL LocalDB 2016.")]
public void SqlLocalDbApi_DefaultInstanceName_Returns_Correct_Value_2016()
{
// Arrange
Helpers.InvokeInNewAppDomain(
() =>
{
// Act
string result = SqlLocalDbApi.DefaultInstanceName;

// Assert
Assert.AreEqual("MSSQLLocalDB", result, "SqlLocalDbApi.DefaultInstanceName returned incorrect value.");
},
configurationFile: "SqlLocalDbApiTests.DefaultInstanceName.2016.config");
}

[TestMethod]
[Description("Tests that the LanguageId property returns the correct default value.")]
public void SqlLocalDbApi_LanguageId_Returns_Correct_Value()
Expand Down
5 changes: 3 additions & 2 deletions src/SqlLocalDb.UnitTests/SqlLocalDbProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,9 @@ public void SqlLocalDbProvider_CreateInstance_Specifies_No_Version_If_Default_In

[TestMethod]
[TestCategory(TestCategories.SqlServer2014)]
[Description("Tests CreateInstance(string) uses the specfied version of SQL LocalDB if overridden for SQL Server LocalDB 2014.")]
public void SqlLocalDbProvider_CreateInstance_Specifies_No_Version_If_Default_Instance_Name_Specified_2014()
[TestCategory(TestCategories.SqlServer2016)]
[Description("Tests CreateInstance(string) uses the specfied version of SQL LocalDB if overridden for SQL Server LocalDB 2014 and 2016.")]
public void SqlLocalDbProvider_CreateInstance_Specifies_No_Version_If_Default_Instance_Name_Specified_2014_2016()
{
// Arrange
string instanceName = "MSSQLLocalDB";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@
<None Include="SqlLocalDbApiTests.DefaultInstanceName.2012.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SqlLocalDbApiTests.DefaultInstanceName.2016.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SqlLocalDbApiTests.DefaultInstanceName.2014.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down

0 comments on commit a5b02df

Please sign in to comment.