Skip to content

Commit

Permalink
Merge pull request #101 from CodebreakerApp/100-libs-dotnet8
Browse files Browse the repository at this point in the history
100 libs dotnet8
  • Loading branch information
christiannagel authored Dec 9, 2023
2 parents d1ab6c3 + 8b2288a commit 78ad2cb
Showing 3 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -10,11 +10,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0-preview.6.23329.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Original file line number Diff line number Diff line change
@@ -2,10 +2,8 @@

namespace Codebreaker.GameAPIs.Client.Tests;

public class TestGamesClient(ITestOutputHelper outputHelper)
public class TestGamesClient
{
private readonly ITestOutputHelper _outputHelper = outputHelper;

[Fact]
public async Task TestStartGame6x4Async()
{
@@ -46,20 +44,20 @@ public async Task TestStartGame6x4Async()

HttpClient httpClient = new(handlerMock.Object)
{
BaseAddress = new System.Uri(configMock.Object["GameAPIs"] ?? throw new InvalidOperationException())
BaseAddress = new Uri(configMock.Object["GameAPIs"] ?? throw new InvalidOperationException())
};

var gamesClient = new GamesClient(httpClient, NullLogger<GamesClient>.Instance);

// Act
var response = await gamesClient.StartGameAsync(Models.GameType.Game6x4, "test");
var (GameId, NumberCodes, MaxMoves, FieldValues) = await gamesClient.StartGameAsync(Models.GameType.Game6x4, "test");

// Assert
Assert.Equal(4, response.NumberCodes);
Assert.Equal(12, response.MaxMoves);
Assert.Single(response.FieldValues.Keys);
Assert.Equal("colors", response.FieldValues.Keys.First());
Assert.Equal(6, response.FieldValues["colors"].Length);
Assert.Equal(4, NumberCodes);
Assert.Equal(12, MaxMoves);
Assert.Single(FieldValues.Keys);
Assert.Equal("colors", FieldValues.Keys.First());
Assert.Equal(6, FieldValues["colors"].Length);

handlerMock.Protected().Verify(
"SendAsync",
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0-rc.2.23479.6" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
</ItemGroup>

</Project>

0 comments on commit 78ad2cb

Please sign in to comment.