checkpoint
This commit is contained in:
26
Gameboard.ShogiUI.UnitTests/BoardState/BoardVectorShould.cs
Normal file
26
Gameboard.ShogiUI.UnitTests/BoardState/BoardVectorShould.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user