Files
Shogi/Gameboard.ShogiUI.UnitTests/BoardState/BoardVectorShould.cs
2021-02-23 18:03:23 -06:00

27 lines
690 B
C#

using FluentAssertions;
using Gameboard.ShogiUI.BoardState;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Gameboard.ShogiUI.UnitTests.BoardState
{
[TestClass]
public class BoardVectorShould
{
[TestMethod]
public void BeEqualWhenPropertiesAreEqual()
{
var a = new BoardVector(3, 2);
var b = new BoardVector(3, 2);
a.Should().Be(b);
a.GetHashCode().Should().Be(b.GetHashCode());
(a == b).Should().BeTrue();
// Properties should not be transitively equal.
b = new BoardVector(2, 3);
a.Should().NotBe(b);
a.GetHashCode().Should().NotBe(b.GetHashCode());
(a == b).Should().BeFalse();
}
}
}