public async Task Should_create_game() { var builder = new GameBuilder() .TicTacToe .MinMaxPlayers(2, 4) .Open .FirstPlayerEinstein; var game = builder.Build(); // need to get another one since mongodb will alter it (to add id for example) // Act var createdGame = await _repository.CreateGameAsync(builder.Build()); createdGame.Should().BeEquivalentTo(game, options => options.Excluding(e => e.Id)); createdGame.Id.Should().NotBeNullOrWhiteSpace(); }
public TicTacToe Build() { var game = _gameBuilder.Build(); var tictactoe = _mapper.Map <Game, TicTacToe>(game); tictactoe.Cells = _cells; return(tictactoe); }
public PlayerBuilder AddGame(GameBuilder builder) { return(AddGame(builder.Build())); }