private static IGameBuilder BuildGameBuilder(IStartingPlayerMapper startingPlayerMapper = null, IPlayers players = null, IBoardService boardService = null, int?size = null, IPlayerType firstPlayerType = null, IPlayerType secondPlayerType = null, IStartingPlayer startingPlayer = null) { startingPlayerMapper = startingPlayerMapper ?? new MockStartingPlayerMapper().AddReturnsItself(); players = players ?? new MockPlayers().AddReturnsItself(); boardService = boardService ?? new MockBoardService(); size = size ?? 3; firstPlayerType = firstPlayerType ?? new MockPlayerType(); secondPlayerType = secondPlayerType ?? new MockPlayerType(); startingPlayer = startingPlayer ?? new MockStartingPlayer(); return(GameBuilder .Initialize(startingPlayerMapper, players, boardService) .WithBoardSize(size.Value) .FirstPlayerSet(firstPlayerType) .SecondPlayerSet(secondPlayerType) .Set(startingPlayer)); }
public IStartingPlayerMapper Add(IStartingPlayer startingPlayer, IPlayer player) => _mock.Object.Add(startingPlayer, player);
public IPlayer this[IStartingPlayer key] => _mock.Object[key];
public void VerifyKeyCalled(IStartingPlayer startingPlayer, int times = 1) { _mock.Verify(m => m[startingPlayer], Times.Exactly(times)); }
public void VerifyAddCalled(IStartingPlayer startingPlayer, IPlayer player, int times = 1) { _mock.Verify(m => m.Add(startingPlayer, player), Times.Exactly(times)); }
public IGameBuilder Set(IStartingPlayer startingPlayer) { _players = _players.SetCurrentPlayer(_startingPlayerMapper[startingPlayer]); return(this); }