public void Test_RemovePlayer_ByExistingPlayer_IsOk() { Table table = new Table(4); Player player = new Player(500, 0); table.AddPlayer(player); Assert.DoesNotThrow(() => table.RemovePlayer(player)); }
public void Test_RemovePlayer_EmptyTable_ThrowsException() { Table table = new Table(4); var player = new Player(500, 0); Exception exception = Assert.Throws <Exception>(() => table.RemovePlayer(player)); Assert.AreEqual(exception.Message, "This player is not sitting in the table"); }
public void Test_RemovePlayer_FromSeatNumber_IsOk(int seatNumber) { Table table = new Table(4); table.AddPlayer(new Player(500, 0)); table.AddPlayer(new Player(500, 0)); table.AddPlayer(new Player(500, 0)); table.AddPlayer(new Player(500, 0)); Assert.DoesNotThrow(() => table.RemovePlayer(seatNumber)); }
public void Test_RemovePlayer_FromNonExistingSeat_ThrowsException() { Table table = new Table(4); table.AddPlayer(new Player(500, 0)); table.AddPlayer(new Player(500, 0)); Exception exception = Assert.Throws <Exception>(() => table.RemovePlayer(8)); Assert.AreEqual(exception.Message, "Sorry, seat not found"); }
public void Test_RemovePlayer_FromEmptySeat_ThrowsException() { Table table = new Table(4); table.AddPlayer(new Player(500, 0)); table.AddPlayer(new Player(500, 0)); Exception exception = Assert.Throws <Exception>(() => table.RemovePlayer(3)); Assert.AreEqual(exception.Message, "This seat is empty"); }
public void Test_RemovePlayer_DoesNotExist_ThrowsException() { Table table = new Table(4); table.AddPlayer(new Player(500, 0)); table.AddPlayer(new Player(500, 0)); Exception exception = Assert.Throws <Exception>(() => table.RemovePlayer(new Player(500, 0))); Assert.AreEqual(exception.Message, "This player is not sitting in the table"); }