Skip to content

Commit 416da77

Browse files
committed
Updated tests to use .NET 5
Currently, none of the core OnTopic libraries rely on .NET 5 specific capabilities and, therefore, none of them multi-target .NET 5. That said, we _expect_ most implementors to be using .NET 5 and, therefore, it makes sense that the test hosts will be running in .NET 5 themselves. That should also provide them with some minor performance benefits. For reasons that aren't entirely clear, migrating the `OnTopic.Tests` project to .NET 5 required introducing its own copy of `IsExternalInit`. This is surprising since a) this is available in `OnTopic`, which makes its internals visible to `OnTopic.Tests`, and b) this class is available in .NET 5. Regardless, an easy fix and one we don't expect to affect most scenarios, since internals aren't usually made available outside of unit tests.
1 parent 9f2da06 commit 416da77

3 files changed

Lines changed: 21 additions & 4 deletions

File tree

OnTopic.AspNetCore.Mvc.Tests/OnTopic.AspNetCore.Mvc.Tests.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
5-
<LangVersion>9.0</LangVersion>
4+
<TargetFrameworks>net5.0</TargetFrameworks>
65
<IsPackable>false</IsPackable>
76
</PropertyGroup>
87

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*==============================================================================================================================
2+
| Author Ignia, LLC
3+
| Client Ignia, LLC
4+
| Project Topics Library
5+
\=============================================================================================================================*/
6+
7+
namespace System.Runtime.CompilerServices {
8+
9+
/*============================================================================================================================
10+
| CLASS: IS EXTERNAL INIT
11+
\---------------------------------------------------------------------------------------------------------------------------*/
12+
/// <summary>
13+
/// The <see cref="IsExternalInit"/> class is made available as part of the .NET 5.0 CLR in order to enable init accessors.
14+
/// As this is not available in .NET Standard, however, we must maintain this separate copy until we migrate to .NET 5.0.
15+
/// </summary>
16+
internal static class IsExternalInit {
17+
18+
} //Class
19+
} //Namespace

OnTopic.Tests/OnTopic.Tests.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
5-
<LangVersion>9.0</LangVersion>
4+
<TargetFrameworks>net5.0</TargetFrameworks>
65
<IsPackable>false</IsPackable>
76
<NoWarn>CS1591,1701,1702,CA1707,CA1062,CS8602,CS8604;CA1303;IDE0059</NoWarn>
87
<Nullable>enable</Nullable>

0 commit comments

Comments
 (0)