public void EqualityTest() { Duration duration = new Duration(2, 4); IEnumerable <Note> notes1 = new List <Note>() { new Note(new Duration(1, 8)), new Note(new Duration(1, 8)), new Note(new Duration(1, 4)) }; IEnumerable <Beat> beats1 = new List <Beat>() { new Beat(duration, notes1) }; IEnumerable <Note> notes2 = new List <Note>() { new Note(new Duration(1, 4)), new Note(new Duration(1, 4)) }; IEnumerable <Beat> beats2 = new List <Beat>() { new Beat(duration, notes2) }; Sheet sheet1 = new Sheet(beats1, duration); Sheet sheet2 = new Sheet(beats1, duration); Sheet sheet3 = new Sheet(beats2, duration); EqualityTests.TestEqualObjects(sheet1, sheet2); EqualityTests.TestUnequalObjects(sheet1, sheet3); EqualityTests.TestAgainstNull(sheet1); }
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 EqualityTest() { Duration duration1 = new Duration(2, 4); Duration duration2 = new Duration(2, 4); Duration duration3 = new Duration(3, 4); EqualityTests.TestEqualObjects(duration1, duration2); EqualityTests.TestUnequalObjects(duration1, duration3); EqualityTests.TestAgainstNull(duration1); }
public void EqualityTest() { Note note1 = new Note(new Duration(1, 8)); Note note2 = new Note(new Duration(1, 8)); Note note3 = new Note(new Duration(1, 4)); EqualityTests.TestEqualObjects(note1, note2); EqualityTests.TestUnequalObjects(note1, note3); EqualityTests.TestAgainstNull(note1); }
public void EqualityTest() { Fraction fraction1 = new Fraction(2, 4); Fraction fraction2 = new Fraction(2, 4); Fraction fraction3 = new Fraction(3, 4); EqualityTests.TestEqualObjects(fraction1, fraction2); EqualityTests.TestUnequalObjects(fraction1, fraction3); EqualityTests.TestAgainstNull(fraction1); }
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(); }
public void EqualityTest() { List <Note> notes1 = new List <Note>() { new Note(new Duration(1, 4)), new Note(new Duration(1, 4)), new Note(new Duration(1, 4)) }; Duration duration1 = new Duration(3, 4); Beat beat1 = new Beat(duration1, notes1); Beat beat2 = new Beat(duration1, notes1); List <Note> notes3 = new List <Note>() { new Note(new Duration(1, 4)), new Note(new Duration(1, 4)), new Note(new Duration(2, 4)) }; Duration duration3 = new Duration(4, 4); Beat beat3 = new Beat(duration3, notes3); EqualityTests.TestEqualObjects(beat1, beat2); EqualityTests.TestUnequalObjects(beat1, beat3); EqualityTests.TestAgainstNull(beat1); }