-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+semver:major
- Loading branch information
Showing
3 changed files
with
18 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,22 @@ | ||
using NUnit.Framework; | ||
using SqlAlias; | ||
|
||
namespace Tests | ||
namespace Tests; | ||
|
||
public class AllTheTests | ||
{ | ||
public class AllTheTests | ||
[Test] | ||
public void CorrectlyDetectsWhetherSubstitutionIsRequired() | ||
{ | ||
[Test] | ||
public void CorrectlyDetectsWhetherSubstitutionIsRequired() | ||
{ | ||
var result = Aliases.ShouldSubstitute(); | ||
#if NET40 || NET45 || NET472 | ||
Assert.IsFalse(result); | ||
#else | ||
Assert.IsTrue(result); | ||
#endif | ||
} | ||
var result = Aliases.ShouldSubstitute(); | ||
Assert.That(result, Is.True); | ||
} | ||
|
||
[Test] | ||
public void MapReturnsTheSameConnectionStringIfThereIsNoSubstitute() | ||
{ | ||
const string connectionString = "Data Source=myServerAddress;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword"; | ||
var result = Aliases.Map(connectionString); | ||
Assert.AreEqual(connectionString, result); | ||
} | ||
[Test] | ||
public void MapReturnsTheSameConnectionStringIfThereIsNoSubstitute() | ||
{ | ||
const string connectionString = "Data Source=myServerAddress;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword"; | ||
var result = Aliases.Map(connectionString); | ||
Assert.That(result, Is.EqualTo(connectionString)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net40;net45;net472;netcoreapp3.1;net5.0</TargetFrameworks> | ||
<TargetFramework>net8.0</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\SqlAlias\SqlAlias.csproj" /> | ||
<PackageReference Include="NUnit" Version="3.13.1" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" /> | ||
<PackageReference Include="NUnit" Version="4.1.0" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |