Skip to content

Commit

Permalink
Adds explicit testing for NET5 and removes NETCoreApp2.1 (#152)
Browse files Browse the repository at this point in the history
* Adds explicit testing for NET5

* Removes explicit testing for .NET Core App 2.1
  • Loading branch information
danielwertheim committed Feb 19, 2021
1 parent ae3293d commit 9abb929
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 11 deletions.
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# top-most EditorConfig file
root = true

# Baseline
[*]
charset = utf-8
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
max_line_length = 160

[*.{yml,json}]
indent_size = 2

# Xml project files
[*.{csproj}]
indent_size = 2

# Xml files (data, config, projects)
[*.{xml,props,targets,config,csproj}]
indent_size = 2

# Shell scripts
[*.sh]
end_of_line = lf

# C#
[*.cs]
charset = utf-8-bom
dotnet_sort_system_directives_first = true
12 changes: 6 additions & 6 deletions azure-templates/stage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ stages:
testRunTitle: 'UnitTests .Net4.5.2'

- task: DotNetCoreCLI@2
displayName: 'UnitTests .NetCoreApp2.2'
displayName: 'UnitTests .NetCoreApp3.1'
inputs:
command: test
projects: 'src/Tests/**/UnitTests.csproj'
arguments: '-c $(BuildConfiguration) -f netcoreapp2.1 --no-build'
testRunTitle: 'UnitTests .NetCoreApp2.1'
arguments: '-c $(BuildConfiguration) -f netcoreapp3.1 --no-build'
testRunTitle: 'UnitTests .NetCoreApp3.1'

- task: DotNetCoreCLI@2
displayName: 'UnitTests .NetCoreApp3.0'
displayName: 'UnitTests .Net5'
inputs:
command: test
projects: 'src/Tests/**/UnitTests.csproj'
arguments: '-c $(BuildConfiguration) -f netcoreapp3.1 --no-build'
testRunTitle: 'UnitTests .NetCoreApp3.1'
arguments: '-c $(BuildConfiguration) -f net5.0 --no-build'
testRunTitle: 'UnitTests .Net5'

- task: DotNetCoreCLI@2
displayName: 'Pack Nupkg'
Expand Down
3 changes: 1 addition & 2 deletions src/tests/Benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/UnitTests/UnitTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ private static void AssertThrowedAsExpected(ArgumentException ex, string expecte
expectedMessage = string.Format(expectedMessage, formattingArgs);

ex.ParamName.Should().Be(ParamName);
#if NETCOREAPP3_1
#if NETCOREAPP3_1 || NET5_0
var x = $"{expectedMessage} (Parameter 'test')";
#else
var x = $"{expectedMessage}{Environment.NewLine}Parameter name: test";
Expand Down
4 changes: 2 additions & 2 deletions src/tests/UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net452;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net452;netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
Expand Down

0 comments on commit 9abb929

Please sign in to comment.