Skip to content

Commit a0f246d

Browse files
committed
targets net10 in tests
updates test project to target .net 10.
1 parent fbe89d7 commit a0f246d

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Microsoft.CodeAnalysis.Testing;
2+
3+
namespace GitVersion.Cli.Generator.Tests;
4+
5+
public static class Extensions
6+
{
7+
extension(ReferenceAssemblies)
8+
{
9+
public static ReferenceAssemblies Net10 =>
10+
new("net10.0", new PackageIdentity("Microsoft.NETCore.App.Ref", "10.0.0"), Path.Combine("ref", "net10.0"));
11+
}
12+
}

new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<!-- Enable the NUnit runner, this is an opt-in feature -->
5+
<EnableNUnitRunner>true</EnableNUnitRunner>
6+
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
7+
8+
<!--
9+
Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
10+
For more information, visit https://learn.microsoft.com/dotnet/core/testing/microsoft-testing-platform-integration-dotnet-test#show-failure-per-test
11+
-->
12+
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
13+
14+
<OutputType>Exe</OutputType>
415
<RootNamespace>GitVersion.Cli.Generator.Tests</RootNamespace>
516
<IsPackable>false</IsPackable>
617
</PropertyGroup>
@@ -10,7 +21,6 @@
1021
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
1122
<PackageReference Include="System.CommandLine" />
1223

13-
<PackageReference Include="Microsoft.CSharp" />
1424
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" />
1525
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
1626
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />

new-cli/GitVersion.Cli.Generator.Tests/SystemCommandlineGeneratorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public async Task ValidateGeneratedCommandImplementation()
252252
(generatorType,"RootCommandImpl.g.cs", ExpectedRootCommandImplText),
253253
(generatorType,"CliAppImpl.g.cs", ExpectedCliAppImplText),
254254
},
255-
ReferenceAssemblies = ReferenceAssemblies.Net.Net90,
255+
ReferenceAssemblies = ReferenceAssemblies.Net10,
256256
AdditionalReferences =
257257
{
258258
MetadataReference.CreateFromFile(typeof(ILogger).Assembly.Location),

0 commit comments

Comments
 (0)