Skip to content

Commit

Permalink
Fixing test warnings for #44, upgrading test project for .NET 5
Browse files Browse the repository at this point in the history
  • Loading branch information
andmos committed Jan 10, 2021
1 parent 387c09b commit 0361c48
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as builder
FROM mcr.microsoft.com/dotnet/sdk:5.0 as builder

ARG VERSION_SUFFIX

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ private SemanticVersion(Version version, string specialVersion, string originalS
{
if (version == null)
{
var foo = "bar";
throw new ArgumentNullException("version");

throw new ArgumentNullException("version");
}
Version = NormalizeVersionValue(version);
SpecialVersion = specialVersion ?? String.Empty;
Expand Down
14 changes: 7 additions & 7 deletions src/BikeshareClient/TestBikeshareClient/TestBikeShareClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public async Task GetStationsStatusAsync_GivenCorrectBaseUrlWithGbfsDiscoveryFil

var clientRespons = await client.GetStationsStatusAsync();

Assert.True(clientRespons.Any(s => s.Returning));
Assert.Contains(clientRespons, s => s.Returning);
}

[Theory]
Expand All @@ -234,7 +234,7 @@ public async Task GetStationsStatusAsync_GivenCorrectBaseUrlWithGbfsDiscoveryFil

var clientRespons = await client.GetStationsStatusAsync();

Assert.True(clientRespons.Any(s => s.Renting));
Assert.Contains(clientRespons, s => s.Returning);
}

[Theory]
Expand All @@ -245,7 +245,7 @@ public async Task GetStationsStatusAsync_GivenCorrectBaseUrlWithGbfsDiscoveryFil

var clientResponse = await client.GetStationsStatusAsync();

Assert.NotNull(clientResponse.FirstOrDefault().LastReported);
Assert.NotEqual(default(DateTime), clientResponse.FirstOrDefault().LastReported);
}

[Theory]
Expand All @@ -257,14 +257,14 @@ public async Task GetStationsStatusAsync_GivenCorrectBaseUrlWithGbfsDiscoveryFil
var clientResponse = await client.GetStationsStatusAsync();
var firstStationStatus = clientResponse.FirstOrDefault();

Assert.NotNull(firstStationStatus.LastReported);
Assert.NotEqual(default(DateTime), firstStationStatus.LastReported);
Assert.NotEmpty(firstStationStatus.Id);
Assert.True(firstStationStatus.Installed);
Assert.NotNull(firstStationStatus.BikesAvailable);
Assert.IsType<int>(firstStationStatus.BikesAvailable);
Assert.IsType<bool>(firstStationStatus.Renting);
Assert.NotNull(firstStationStatus.BikesDisabled);
Assert.IsType<int>(firstStationStatus.BikesDisabled);
Assert.IsType<bool>(firstStationStatus.Returning);
Assert.NotNull(firstStationStatus.DocksAvailable);
Assert.IsType<int>(firstStationStatus.DocksAvailable);
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
<ReleaseVersion>1.0.1</ReleaseVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/TestScript/main.csx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#r "nuget: BikeshareClient, 3.2.1"
#r "nuget: BikeshareClient, 3.2.4"

using BikeshareClient;
using BikeshareClient.Providers;
Expand Down

0 comments on commit 0361c48

Please sign in to comment.