public void AddingOnePlayerToWaitingQueue() { var accessStackWithNew = GetPrivateMethodInfoFor("AccessQueueWithNew"); const string player1 = "player1"; Mock <IGameMappable> gameMapperMock = new Mock <IGameMappable>(); accessStackWithNew.Invoke(null, new Object[] { player1, gameMapperMock.Object }); Assert.AreEqual(1, WaitingPlayerQueueRef.Count); Assert.AreEqual(player1, WaitingPlayerQueueRef.Peek()); }
public void AddingThreePlayersToWaitingQueue() { var accessStackWithNew = GetPrivateMethodInfoFor("AccessQueueWithNew"); const string player1 = "player1"; const string player2 = "player2"; const string player3 = "player3"; Mock <IGameMappable> gameMapperMock = new Mock <IGameMappable>(); gameMapperMock.Setup(x => x.Add(player1, player2)); accessStackWithNew.Invoke(null, new Object[] { player1, gameMapperMock.Object }); accessStackWithNew.Invoke(null, new Object[] { player2, gameMapperMock.Object }); accessStackWithNew.Invoke(null, new Object[] { player3, gameMapperMock.Object }); Assert.AreEqual(1, WaitingPlayerQueueRef.Count); Assert.AreEqual(player3, WaitingPlayerQueueRef.Peek()); gameMapperMock.Verify(x => x.Add(player1, player2), Times.Once); }
public void MyTestInitialize() { WaitingPlayerQueueRef.Clear(); Assert.AreEqual(0, WaitingPlayerQueueRef.Count); }