Skip to content

Commit 2f62e17

Browse files
committed
Fixed non-NET 8 tests
1 parent e2086a8 commit 2f62e17

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

Test/Test.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

9-
<ItemGroup>
10-
<None Remove="TestData\example3-appsettings.json" />
11-
</ItemGroup>
12-
139
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0'">
1410
<PackageReference Include="EfCore.TestSupport" Version="6.0.0" />
1511
<PackageReference Include="EntityFrameworkCore.Exceptions.SqlServer" Version="6.0.3.1" />
@@ -59,6 +55,8 @@
5955

6056
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
6157
<PackageReference Include="xunit" Version="2.5.0" />
58+
<PackageReference Include="xunit.assert" Version="2.5.0" />
59+
<PackageReference Include="xunit.core" Version="2.5.0" />
6260
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
6361
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
6462
<PrivateAssets>all</PrivateAssets>

Test/TestData/example3-appsettings.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"ConnectionStrings": {
3-
"DefaultConnection":
4-
"Server=(localdb)\\mssqllocaldb;Database=aspnet-Example3.MvcWebApp.IndividualAccounts-66CDC4E0-F9E0-486F-8199-D13455BF1415;Trusted_Connection=True;MultipleActiveResultSets=true"
3+
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-Example3.MvcWebApp.IndividualAccounts-66CDC4E0-F9E0-486F-8199-D13455BF1415;Trusted_Connection=True;MultipleActiveResultSets=true"
54
},
65
"Logging": {
76
"LogLevel": {
@@ -16,6 +15,5 @@
1615
"Email": "[email protected]",
1716
"Password": "[email protected]"
1817
},
19-
"DemoUsers":
20-
18+
2119
}

Test/UnitTests/TestExamples/TestExamplesStartup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public async Task TestExample3RunMethodsSequentiallyAsync()
103103
//Have to manually add configuration, using a copy of the Example3 appsettings.json file (ASP.NET Core adds this by default)
104104
var configBuilder = new ConfigurationBuilder()
105105
.SetBasePath(TestData.GetTestDataDir())
106-
.AddJsonFile("example3-appsettings.json", optional: true);
106+
.AddJsonFile("example3-appsettings.json", optional: false);
107107
builder.Services.AddSingleton<IConfiguration>(configBuilder.Build());
108108

109109
//Regsiter the Example3 invoice DbContext

0 commit comments

Comments
 (0)