Better communication

This commit is contained in:
2021-02-19 20:19:11 -06:00
parent d76e4f7a8b
commit 8d79c75616
11 changed files with 156 additions and 64 deletions

View File

@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Gameboard.ShogiUI.Sockets.ServiceModels\Gameboard.ShogiUI.Sockets.ServiceModels.csproj" />
<ProjectReference Include="..\Gameboard.ShogiUI.Sockets\Gameboard.ShogiUI.Sockets.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,27 @@
using FluentAssertions;
using Gameboard.ShogiUI.Sockets.Models;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Gameboard.ShogiUI.Sockets.UnitTests.Models
{
[TestClass]
public class CoordsModelShould
{
[TestMethod]
public void ConvertToNotation()
{
var letters = "ABCDEFGHI";
for (var x = 0; x < 8; x++) // file
{
for (var y = 0; y < 8; y++) // rank
{
var move = new Coords(x, y);
var actual = move.ToBoardNotation();
var expected = $"{letters[x]}{y + 1}";
actual.Should().Be(expected);
}
}
}
}
}