public async Task Should_Coop_Vs_Cheater() { var repositoryMock = new Mock <IStrategyRepository>(); StrategyService strategyService = new StrategyService(repositoryMock.Object); Player player = ConditionalPlayers.GetCheaterVsCooperator(); string enemyId = Guid.NewGuid().ToString(); List <PlayerMove> moves = new List <PlayerMove>() { new PlayerMove() { PlayerId = player.Id, Type = MoveType.Cooperate }, new PlayerMove() { PlayerId = enemyId, Type = MoveType.Cheat } }; var rounds = new List <Round>() { new Round() { PlayersMoves = moves }, new Round() { PlayersMoves = moves }, }; PlayerMove move = await strategyService.GetNextMoveAsync(player, rounds); Assert.AreEqual(MoveType.Cooperate, move.Type); }
public async Task Should_Cheat_Vs_Cooperator() { var repositoryMock = new Mock <IStrategyRepository>(); StrategyService strategyService = new StrategyService(repositoryMock.Object); Player player = ConditionalPlayers.GetCheaterVsCooperator(); PlayerMove move = await strategyService.GetNextMoveAsync(player, GetCoopHistory(Guid.NewGuid().ToString(), player.Id)); Assert.AreEqual(MoveType.Cheat, move.Type); }
public async Task Copycat_Should_Cooperate() { var repositoryMock = new Mock <IStrategyRepository>(); StrategyService strategyService = new StrategyService(repositoryMock.Object); Player player = BasicPlayers.GetCheaterPlayer(); PlayerMove move = await strategyService.GetNextMoveAsync(player, GetCoopHistory(player.Id, Guid.NewGuid().ToString())); Assert.AreEqual(MoveType.Cheat, move.Type); }