Skip to content

Commit 2a4ca9d

Browse files
committed
More testing fixes for file paths
1 parent 923d6fe commit 2a4ca9d

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

Inforigami.Regalo.SqlServer.Tests.Unit/DatabaseInstaller.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Configuration;
1+
using System;
2+
using System.Configuration;
23
using System.Data;
34
using System.IO;
45
using System.Threading.Tasks;
@@ -20,8 +21,8 @@ static DatabaseInstaller()
2021

2122
public static async Task Install()
2223
{
23-
await RunScript("UnitTestSetUpConnection", ".\\CreateDatabase.sql");
24-
await RunScript("RegaloConnection", ".\\InstallEventStreamTables.sql");
24+
await RunScript("UnitTestSetUpConnection", Path.Combine(AppContext.BaseDirectory, "CreateDatabase.sql"));
25+
await RunScript("RegaloConnection", Path.Combine(AppContext.BaseDirectory, "InstallEventStreamTables.sql"));
2526
}
2627

2728
private static async Task RunScript(string connectionName, string filename)

Inforigami.Regalo.SqlServer.Tests.Unit/Inforigami.Regalo.SqlServer.Tests.Unit.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
<TargetFrameworks>net8.0</TargetFrameworks>
44
</PropertyGroup>
55
<ItemGroup>
6-
<None Include="..\Inforigami.Regalo.SqlServer\InstallEventStreamTables.sql" Link="InstallEventStreamTables.sql">
7-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
8-
</None>
6+
<Content Include="CreateDatabase.sql">
7+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
8+
</Content>
9+
<Content Include="..\Inforigami.Regalo.SqlServer\InstallEventStreamTables.sql" Link="InstallEventStreamTables.sql">
10+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
11+
</Content>
912
</ItemGroup>
1013
<ItemGroup>
1114
<PackageReference Include="gitversion.msbuild" Version="5.11.0">
@@ -27,8 +30,5 @@
2730
<None Update="appsettings.json">
2831
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2932
</None>
30-
<None Update="CreateDatabase.sql">
31-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
32-
</None>
3333
</ItemGroup>
3434
</Project>

0 commit comments

Comments
 (0)