Skip to content

Commit

Permalink
Fix the name of the SQL server for the LocalDB
Browse files Browse the repository at this point in the history
  • Loading branch information
GillesTourreau committed Sep 27, 2024
1 parent 2842da9 commit ed54cb4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/github-actions-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:
- name: Build the samples
run: msbuild "samples/PosInformatique.Testing.Databases.Samples.sln" /p:Configuration=Debug

- name: Creates the LocalDB for the unit tests
- name: Creates the LocalDB for the tests
shell: cmd
run: SqlLocalDB create posinfo-unit-tests
run: SqlLocalDB create posinfo-tests

- name: Creates the SQL Login service accounts for the unit tests
- name: Creates the SQL Login service accounts for the tests
shell: cmd
run: sqlcmd -S "(localDB)\posinfo-unit-tests" -Q "IF NOT EXISTS (SELECT 1 FROM [sys].[server_principals] WHERE [Name] = 'ServiceAccountLogin') CREATE LOGIN [ServiceAccountLogin] WITH PASSWORD = 'P@ssw0rd'"
run: sqlcmd -S "(localDB)\posinfo-tests" -Q "IF NOT EXISTS (SELECT 1 FROM [sys].[server_principals] WHERE [Name] = 'ServiceAccountLogin') CREATE LOGIN [ServiceAccountLogin] WITH PASSWORD = 'P@ssw0rd'"

# Use this fix https://github.com/microsoft/vstest-action/issues/31#issuecomment-2159463764
- name: Test with the dotnet CLI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace PosInformatique.Testing.Databases.SqlServer.Tests
[Collection("PosInformatique.Testing.Databases.SqlServer.Tests")]
public class EntityFrameworkDatabaseInitializerExtensionsTest : IClassFixture<SqlServerDatabaseInitializer>
{
private const string ConnectionString = $"Data Source=(localDB)\\posinfo-unit-tests; Initial Catalog={nameof(EntityFrameworkDatabaseInitializerExtensionsTest)}; Integrated Security=True";
private const string ConnectionString = $"Data Source=(localDB)\\posinfo-tests; Initial Catalog={nameof(EntityFrameworkDatabaseInitializerExtensionsTest)}; Integrated Security=True";

private readonly SqlServerDatabase database;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ namespace PosInformatique.Testing.Databases.SqlServer.Tests
{
using Microsoft.EntityFrameworkCore;

[Collection("PosInformatique.UnitTests.Databases.SqlServer.Tests")]
[Collection("PosInformatique.Testing.Databases.SqlServer.Tests")]
public class EntityFrameworkSqlServerExtensionsTest
{
private const string ConnectionString = $"Data Source=(localDB)\\posinfo-unit-tests; Integrated Security=True";
private const string ConnectionString = $"Data Source=(localDB)\\posinfo-tests; Integrated Security=True";

[Fact]
public async Task Create_WithNoExistingDatabase()
Expand All @@ -26,7 +26,7 @@ public async Task Create_WithNoExistingDatabase()

var database = await server.CreateDatabaseAsync(nameof(EntityFrameworkSqlServerExtensionsTest), dbContext);

database.ConnectionString.Should().Be("Data Source=(localDB)\\posinfo-unit-tests;Initial Catalog=EntityFrameworkSqlServerExtensionsTest;Integrated Security=True");
database.ConnectionString.Should().Be("Data Source=(localDB)\\posinfo-tests;Initial Catalog=EntityFrameworkSqlServerExtensionsTest;Integrated Security=True");

var tables = await database.GetTablesAsync();

Expand Down Expand Up @@ -54,7 +54,7 @@ public async Task Create_WithAlreadyExistingDatabase()

var database = await server.CreateDatabaseAsync(nameof(EntityFrameworkSqlServerExtensionsTest), dbContext);

database.ConnectionString.Should().Be("Data Source=(localDB)\\posinfo-unit-tests;Initial Catalog=EntityFrameworkSqlServerExtensionsTest;Integrated Security=True");
database.ConnectionString.Should().Be("Data Source=(localDB)\\posinfo-tests;Initial Catalog=EntityFrameworkSqlServerExtensionsTest;Integrated Security=True");

var tables = await database.GetTablesAsync();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace PosInformatique.Testing.Databases.SqlServer.Tests
[Collection("PosInformatique.Testing.Databases.SqlServer.Tests")]
public class SqlServerDatabaseComparerTest
{
private const string ConnectionString = $"Data Source=(localDB)\\posinfo-unit-tests; Integrated Security=True";
private const string ConnectionString = $"Data Source=(localDB)\\posinfo-tests; Integrated Security=True";

[Fact]
public async Task CompareAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace PosInformatique.Testing.Databases.SqlServer.Tests
[Collection("PosInformatique.Testing.Databases.SqlServer.Tests")]
public class SqlServerDatabaseExtensionsTest
{
private const string ConnectionString = $"Data Source=(localDB)\\posinfo-unit-tests; Initial Catalog={nameof(SqlServerDatabaseExtensionsTest)}; Integrated Security=True";
private const string ConnectionString = $"Data Source=(localDB)\\posinfo-tests; Initial Catalog={nameof(SqlServerDatabaseExtensionsTest)}; Integrated Security=True";

[Fact]
public void InsertInto_EnableIdentity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace PosInformatique.Testing.Databases.SqlServer.Tests
[Collection("PosInformatique.UniTestingtTests.Databases.SqlServer.Tests")]
public class SqlServerDatabaseInitializerTest : IClassFixture<SqlServerDatabaseInitializer>
{
private const string ConnectionString = $"Data Source=(localDB)\\posinfo-unit-tests; Initial Catalog={nameof(SqlServerDatabaseInitializerTest)}; Integrated Security=True";
private const string ConnectionString = $"Data Source=(localDB)\\posinfo-tests; Initial Catalog={nameof(SqlServerDatabaseInitializerTest)}; Integrated Security=True";

private readonly SqlServerDatabase database;

Expand Down

0 comments on commit ed54cb4

Please sign in to comment.