public void Date_ImplementsObjectEquality() { EqualityTests.For(new Date(2017, 1, 27)) .EqualTo(new Date(2017, 1, 27)) .NotEqualTo(new Date(2012, 1, 27), "different year") .NotEqualTo(new Date(2017, 2, 27), "different month") .NotEqualTo(new Date(2017, 1, 28), "different day") .Assert(); }
public void First_Player_Equalalty_Tests() { var player1 = BuildStartingPlayerAsFirstPlayer(); var player2 = BuildStartingPlayerAsFirstPlayer(); var player3 = BuildStartingPlayerAsSecondPlayer(); EqualityTests.For(player1) .EqualTo(player1) .EqualTo(player2) .NotEqualTo(player3, "different first player type") .Assert(); }
public void Equalalty_Tests() { var someSample1 = BuildSomeSampleObject(); var someSample2 = BuildSomeSampleObject(); var thisSample = BuildThisSampleObject(); var thatSample = BuildThatSampleObject(); var noSample = BuildNoSampleObject(); EqualityTests .For(someSample1) .EqualTo(someSample1) .EqualTo(someSample2) .NotEqualTo(thisSample, "different sample (some to this)") .NotEqualTo(thatSample, "different sample (some to that)") .NotEqualTo(noSample, "different sample (some to none)") .Assert(); }
public void Equalalty_Tests() { const string NAME = "Human 1"; const string DIFFERENT_NAME = "Human 2"; const string SYMBOL = "X"; const string DIFFERENT_SYMBOL = "O"; var player1 = BuildHumanPlayer(NAME, SYMBOL); var player2 = BuildHumanPlayer(NAME, SYMBOL); var player3 = BuildHumanPlayer(DIFFERENT_NAME, SYMBOL); var player4 = BuildHumanPlayer(NAME, DIFFERENT_SYMBOL); EqualityTests.For(player1) .EqualTo(player1) .EqualTo(player2) .NotEqualTo(player3, "different name") .NotEqualTo(player4, "different symbol") .Assert(); }
public void Equalalty_Tests() { const int POSITION = 1; const int DIFFERENT_POSITION = 2; var coordinate = new MockCoordinate(); var differentCoordinate = new MockCoordinate(); var tile1 = BuildOccupiedTile(POSITION, coordinate); var tile2 = BuildOccupiedTile(POSITION, coordinate); var tile3 = BuildOccupiedTile(DIFFERENT_POSITION, coordinate); var tile4 = BuildOccupiedTile(POSITION, differentCoordinate); EqualityTests.For(tile1) .EqualTo(tile1) .EqualTo(tile2) .NotEqualTo(tile3, "different position") .NotEqualTo(tile4, "different coordinate") .Assert(); }
public void Computer_Equalalty_Tests() { const string NAME = "Computer 1"; const string DIFFERENT_NAME = "Computer 2"; const string SYMBOL = "X"; const string DIFFERENT_SYMBOL = "O"; var player1 = BuildPlayerTypeAsComputer(NAME, SYMBOL); var player2 = BuildPlayerTypeAsComputer(NAME, SYMBOL); var player3 = BuildPlayerTypeAsComputer(DIFFERENT_NAME, SYMBOL); var player4 = BuildPlayerTypeAsComputer(NAME, DIFFERENT_SYMBOL); var player5 = BuildPlayerTypeAsHuman(NAME, SYMBOL); EqualityTests.For(player1) .EqualTo(player1) .EqualTo(player2) .NotEqualTo(player3, "different name") .NotEqualTo(player4, "different symbol") .NotEqualTo(player5, "different type") .Assert(); }