Skip to content

Commit 31700a4

Browse files
committed
Update test code for DotNet 10.0
1 parent 1871670 commit 31700a4

21 files changed

Lines changed: 53 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ name: MSBuild (Push)
22

33
on:
44
push:
5-
pull_request:
65
branches: [ main ]
76
paths:
87
- '**.cs'
98
- '**.csproj'
109

10+
pull_request:
11+
1112
env:
1213
REPODB_MYSQL_CONSTR_SYS: "Server=127.0.0.1;Port=43306;Database=sys;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;"
1314
REPODB_ORACLE_CONSTR_MASTER: "Data Source=127.0.0.1:41521/FREEPDB1;User Id=system;Password=oracle;"
@@ -65,9 +66,9 @@ jobs:
6566
6667
- name: build
6768
run: dotnet build -c Release
68-
69+
6970
- name: Run tests for .Net 10.0
70-
run: dotnet test -c Release -f net10.0 --no-build -p:TestingPlatformShowTestsFailure=true -p:TestingPlatformCaptureOutput=false
71+
run: dotnet test -c Release -f net10.0 --no-build
7172

7273
- name: Set version variables
7374
id: version

Directory.Build.props

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<PropertyGroup>
4-
<Authors>Michael Camara Pendon and others</Authors>
4+
<Authors>AmpScm, Michael Camara Pendon and others</Authors>
55
<Company>RepoDb</Company>
66
<Product>RepoDb</Product>
77
<Version Condition="'$(Version)' == ''">0.0.1-dev</Version>
88
<LangVersion>default</LangVersion>
9-
<Copyright>Copyright © 2020-2025</Copyright>
9+
<Copyright>Copyright © 2020-2026</Copyright>
1010
<PackageProjectUrl>https://repodb.net/</PackageProjectUrl>
1111
<RepositoryType>Github</RepositoryType>
1212
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
@@ -21,15 +21,15 @@
2121
<IncludeSymbols>true</IncludeSymbols>
2222
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2323
<DisableTransitiveProjectReferences>true</DisableTransitiveProjectReferences>
24-
<TestTargetFrameworks>net9.0;net8.0;net48</TestTargetFrameworks>
24+
<EnableMSTestRunner>true</EnableMSTestRunner>
25+
<TestTargetFrameworks>net10.0;net9.0;net8.0;net48</TestTargetFrameworks>
26+
<TestTargetOutputType>Exe</TestTargetOutputType>
27+
<TestingPlatformDotnetTestRunner>true</TestingPlatformDotnetTestRunner>
2528
<LangVersion>preview</LangVersion>
2629
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(MSBuildProjectName)' != '' and $(MSBuildProjectName.Contains('Test')) ">
28-
<IsTestProject>false</IsTestProject>
29-
</PropertyGroup>
3030
<PropertyGroup>
3131
<!-- Reduce tests while running inside VS -->
32-
<TestTargetFrameworks Condition="'$(VisualStudioVersion)' != '' and '$(BuildingInsideVisualStudio)' == 'true'">net9.0</TestTargetFrameworks>
32+
<TestTargetFrameworks Condition="'$(VisualStudioVersion)' != '' and '$(BuildingInsideVisualStudio)' == 'true'">net10.0</TestTargetFrameworks>
3333
</PropertyGroup>
3434
<Target Name="SetGenerateBeforeBuild" BeforeTargets="Build">
3535
<!-- IsPackable is set in project files, so delay evaluating this -->

Directory.Packages.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<PackageVersion Include="Microsoft.SqlServer.Types" Version="170.1000.7" />
2727
<PackageVersion Include="Moq" Version="4.20.72" />
2828
<PackageVersion Include="MSTest" Version="4.1.0" />
29+
<PackageVersion Include="MSTest.TestAdapter" Version="4.1.0" />
2930
<PackageVersion Include="MSTest.TestFramework" Version="4.1.0" />
3031
<PackageVersion Include="MySql.Data" Version="9.4.0" />
3132
<PackageVersion Include="MySqlConnector" Version="2.5.0" />
@@ -43,4 +44,4 @@
4344
<ItemGroup>
4445
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
4546
</ItemGroup>
46-
</Project>
47+
</Project>

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"test": {
3+
"runner": "Microsoft.Testing.Platform"
4+
}
5+
}

src/RepoDb.Core.IntegrationTests/RepoDb.Core.IntegrationTests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<IsPackable>false</IsPackable>
66
<IsTestProject>true</IsTestProject>
7+
<OutputType>$(TestTargetOutputType)</OutputType>
78
</PropertyGroup>
89
<PropertyGroup>
910
<NoWarn>$(NoWarn);REPDB002;REPDB003</NoWarn>
1011
</PropertyGroup>
1112
<ItemGroup>
1213
<PackageReference Include="Microsoft.SqlServer.Types" />
1314
<PackageReference Include="MSTest" />
15+
<PackageReference Include="MSTest.TestAdapter" />
1416
</ItemGroup>
1517
<ItemGroup>
1618
<ProjectReference Include="..\RepoDb\RepoDb.csproj" />

src/RepoDb.Core.UnitTests/RepoDb.Core.UnitTests.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<IsPackable>false</IsPackable>
66
<IsTestProject>true</IsTestProject>
7+
<OutputType>$(TestTargetOutputType)</OutputType>
78
</PropertyGroup>
89
<ItemGroup>
910
<PackageReference Include="Moq" />
1011
<PackageReference Include="MSTest" />
12+
<PackageReference Include="MSTest.TestAdapter" />
1113
</ItemGroup>
1214
<ItemGroup>
1315
<ProjectReference Include="..\RepoDb\RepoDb.csproj" />
1416
<ProjectReference Include="..\RepoDb.SqlServer\RepoDb.SqlServer.csproj" />
1517
<ProjectReference Include="..\RepoDb.TestCore\RepoDb.TestCore.csproj" />
1618
</ItemGroup>
17-
</Project>
19+
</Project>

src/RepoDb.MySql.IntegrationTests/RepoDb.MySql.IntegrationTests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<IsPackable>false</IsPackable>
66
<IsTestProject>true</IsTestProject>
7+
<OutputType>$(TestTargetOutputType)</OutputType>
78
</PropertyGroup>
89
<ItemGroup>
910
<PackageReference Include="MSTest" />
11+
<PackageReference Include="MSTest.TestAdapter" />
1012
<PackageReference Include="MySql.Data" />
1113
</ItemGroup>
1214
<ItemGroup>

src/RepoDb.MySql.UnitTests/RepoDb.MySql.UnitTests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<IsPackable>false</IsPackable>
66
<IsTestProject>true</IsTestProject>
7+
<OutputType>$(TestTargetOutputType)</OutputType>
78
</PropertyGroup>
89
<ItemGroup>
910
<PackageReference Include="MSTest" />
11+
<PackageReference Include="MSTest.TestAdapter" />
1012
<PackageReference Include="MySql.Data" />
1113
</ItemGroup>
1214
<ItemGroup>

src/RepoDb.MySqlConnector.IntegrationTests/RepoDb.MySqlConnector.IntegrationTests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<IsPackable>false</IsPackable>
66
<IsTestProject>true</IsTestProject>
7+
<OutputType>$(TestTargetOutputType)</OutputType>
78
</PropertyGroup>
89
<ItemGroup>
910
<PackageReference Include="MSTest" />
11+
<PackageReference Include="MSTest.TestAdapter" />
1012
<PackageReference Include="MySqlConnector" />
1113
</ItemGroup>
1214
<ItemGroup>

src/RepoDb.MySqlConnector.UnitTests/RepoDb.MySqlConnector.UnitTests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<IsPackable>false</IsPackable>
66
<IsTestProject>true</IsTestProject>
7+
<OutputType>$(TestTargetOutputType)</OutputType>
78
</PropertyGroup>
89
<ItemGroup>
910
<PackageReference Include="MSTest" />
11+
<PackageReference Include="MSTest.TestAdapter" />
1012
</ItemGroup>
1113
<ItemGroup>
1214
<ProjectReference Include="..\RepoDb\RepoDb.csproj" />

0 commit comments

Comments
 (0)