Skip to content

Commit e8db377

Browse files
authored
Merge pull request #3 from joncloud/net50
Upgrades to .NET 5.0
2 parents 56b1cf4 + 9f2dfa2 commit e8db377

File tree

9 files changed

+27
-9
lines changed

9 files changed

+27
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Released under the MIT License. See the [LICENSE][] File for further details.
1313
## Installation
1414
Install `https` as a global .NET tool using
1515
```bash
16-
dotnet tool install --global https --version 0.2.0-*
16+
dotnet tool install --global https --version 0.3.0-*
1717
```
1818

1919
## Usage

azure-pipelines.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ variables:
1111
shouldPublish: $[eq(variables['Build.SourceBranch'], 'refs/heads/publish')]
1212

1313
steps:
14+
- task: UseDotNet@2
15+
displayName: Use .NET (global.json)
16+
inputs:
17+
packageType: 'sdk'
18+
useGlobalJson: true
19+
1420
- task: DotNetCoreCLI@2
1521
displayName: Pack https
1622
condition: eq(variables.shouldPublish, true)

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "5.0.100"
4+
}
5+
}

src/https/https.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net5.0</TargetFramework>
66
<LangVersion>preview</LangVersion>
77
</PropertyGroup>
88

99
<PropertyGroup>
10-
<VersionPrefix>0.2.0</VersionPrefix>
10+
<VersionPrefix>0.3.0</VersionPrefix>
1111
</PropertyGroup>
1212

1313
<PropertyGroup>

tests/https.Tests/CertificateTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
namespace Https.Tests
66
{
7-
public class CertificateTests : IClassFixture<WebHostFixture>
7+
[Collection(nameof(WebHostFixture))]
8+
public class CertificateTests
89
{
910
readonly WebHostFixture _fixture;
1011
public CertificateTests(WebHostFixture fixture) =>

tests/https.Tests/ContentTypeTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
namespace Https.Tests
77
{
8-
public class ContentTypeTests : IClassFixture<WebHostFixture>
8+
[Collection(nameof(WebHostFixture))]
9+
public class ContentTypeTests
910
{
1011
readonly WebHostFixture _fixture;
1112
public ContentTypeTests(WebHostFixture fixture) =>

tests/https.Tests/RedirectTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
namespace Https.Tests
55
{
6-
public class RedirectTests : IClassFixture<WebHostFixture>
6+
[Collection(nameof(WebHostFixture))]
7+
public class RedirectTests
78
{
89
readonly WebHostFixture _fixture;
910
public RedirectTests(WebHostFixture fixture) =>

tests/https.Tests/WebHostFixture.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
using System;
44
using System.Threading;
55
using System.Threading.Tasks;
6+
using Xunit;
67

78
namespace Https.Tests
89
{
10+
[CollectionDefinition(nameof(WebHostFixture))]
11+
public class WebHostCollection : ICollectionFixture<WebHostFixture> { }
12+
913
public class WebHostFixture : IDisposable
1014
{
1115
readonly IWebHost _webHost;

tests/https.Tests/https.Tests.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<RootNamespace>Https.Tests</RootNamespace>
77
<LangVersion>preview</LangVersion>
@@ -17,8 +17,8 @@
1717
<PrivateAssets>all</PrivateAssets>
1818
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1919
</PackageReference>
20-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.6" />
21-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
20+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
21+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
2222
<PackageReference Include="xunit" Version="2.4.1" />
2323
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
2424
<PrivateAssets>all</PrivateAssets>

0 commit comments

Comments
 (0)