Skip to content

Commit

Permalink
Merge pull request #3 from joncloud/net50
Browse files Browse the repository at this point in the history
Upgrades to .NET 5.0
  • Loading branch information
joncloud authored Nov 10, 2020
2 parents 56b1cf4 + 9f2dfa2 commit e8db377
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Released under the MIT License. See the [LICENSE][] File for further details.
## Installation
Install `https` as a global .NET tool using
```bash
dotnet tool install --global https --version 0.2.0-*
dotnet tool install --global https --version 0.3.0-*
```

## Usage
Expand Down
6 changes: 6 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ variables:
shouldPublish: $[eq(variables['Build.SourceBranch'], 'refs/heads/publish')]

steps:
- task: UseDotNet@2
displayName: Use .NET (global.json)
inputs:
packageType: 'sdk'
useGlobalJson: true

- task: DotNetCoreCLI@2
displayName: Pack https
condition: eq(variables.shouldPublish, true)
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "5.0.100"
}
}
4 changes: 2 additions & 2 deletions src/https/https.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>preview</LangVersion>
</PropertyGroup>

<PropertyGroup>
<VersionPrefix>0.2.0</VersionPrefix>
<VersionPrefix>0.3.0</VersionPrefix>
</PropertyGroup>

<PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion tests/https.Tests/CertificateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

namespace Https.Tests
{
public class CertificateTests : IClassFixture<WebHostFixture>
[Collection(nameof(WebHostFixture))]
public class CertificateTests
{
readonly WebHostFixture _fixture;
public CertificateTests(WebHostFixture fixture) =>
Expand Down
3 changes: 2 additions & 1 deletion tests/https.Tests/ContentTypeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

namespace Https.Tests
{
public class ContentTypeTests : IClassFixture<WebHostFixture>
[Collection(nameof(WebHostFixture))]
public class ContentTypeTests
{
readonly WebHostFixture _fixture;
public ContentTypeTests(WebHostFixture fixture) =>
Expand Down
3 changes: 2 additions & 1 deletion tests/https.Tests/RedirectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

namespace Https.Tests
{
public class RedirectTests : IClassFixture<WebHostFixture>
[Collection(nameof(WebHostFixture))]
public class RedirectTests
{
readonly WebHostFixture _fixture;
public RedirectTests(WebHostFixture fixture) =>
Expand Down
4 changes: 4 additions & 0 deletions tests/https.Tests/WebHostFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Xunit;

namespace Https.Tests
{
[CollectionDefinition(nameof(WebHostFixture))]
public class WebHostCollection : ICollectionFixture<WebHostFixture> { }

public class WebHostFixture : IDisposable
{
readonly IWebHost _webHost;
Expand Down
6 changes: 3 additions & 3 deletions tests/https.Tests/https.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>Https.Tests</RootNamespace>
<LangVersion>preview</LangVersion>
Expand All @@ -17,8 +17,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
Expand Down

0 comments on commit e8db377

Please sign in to comment.