public void ReinsertPlayer_ThrowsInvalidIndex_WithBadIndexInput() { List <IPlayer> pList = new List <IPlayer>(); for (int i = 1; i <= 8; ++i) { var moq = new Mock <IPlayer>(); moq.Setup(p => p.Id).Returns(i); pList.Add(moq.Object); } IBracket b = new SingleElimBracket(pList); b.ReinsertPlayer(2, -2); Assert.AreEqual(1, 2); }
public void ReinsertPlayer_ShiftsAffectedPlayersUpward() { List <IPlayer> pList = new List <IPlayer>(); for (int i = 1; i <= 8; ++i) { var moq = new Mock <IPlayer>(); moq.Setup(p => p.Id).Returns(i); pList.Add(moq.Object); } IBracket b = new SingleElimBracket(pList); int playerId = b.Players[5].Id; b.ReinsertPlayer(2, 6); Assert.AreEqual(playerId, b.Players[4].Id); }
public void ReinsertPlayer_MovesPlayerDownwardToDestinationSlot() { List <IPlayer> pList = new List <IPlayer>(); for (int i = 1; i <= 8; ++i) { var moq = new Mock <IPlayer>(); moq.Setup(p => p.Id).Returns(i); pList.Add(moq.Object); } IBracket b = new SingleElimBracket(pList); int playerId = b.Players[2].Id; b.ReinsertPlayer(2, 6); Assert.AreEqual(playerId, b.Players[6].Id); }