public void FivePlayersOnlyAttackerCanCallKing() { List <Player> players = Musketeers(5); DealingService dealingService = new DealingService(true, players); var defender = players.First(); defender.Attacker = false; defender.Dealer = true; Assert.Throws <ArgumentException>(() => dealingService.AttackerCallsKing(defender)); }
public void FivePlayersCalledKingInAsideOneAttacker() { List <Player> players = Musketeers(5); PlayerService playerService = new PlayerService(); DealingService dealingService = new DealingService(true, players); DealingRules rules = new DealingRules(); //var dealingServiceMock = new Mock<IDealingService>().Setup(x => x.SendCardsToAside(Kings())); players.First().Dealer = true; players.First().Attacker = true; Player calledPlayer = dealingService.AttackerCallsKing(players.First()); Assert.That(players.Count(x => x.Attacker is false), Is.EqualTo(4)); Assert.That(players.First(), Is.SameAs(calledPlayer)); }
public void FivePlayersAttackerCanCallHimself() { List <Player> players = Musketeers(5); DealingService dealingService = new DealingService(true, players); PlayerService playerService = new PlayerService(); var attacker = players.First(); attacker.Attacker = true; attacker.Hand.AddRange(Kings()); playerService.MakeDealer(attacker); var calledPlayer = dealingService.AttackerCallsKing(attacker); Assert.That(calledPlayer.Name, Is.EqualTo(attacker.Name)); }
public void FivePlayersCallsKingMostCommonCase() { List <Player> players = Musketeers(5); PlayerService playerService = new PlayerService(); DealingService dealingService = new DealingService(true, players); DealingRules rules = new DealingRules(); Player attacker = players.First(); Player defender = players.Last(); attacker.Attacker = true; attacker.Dealer = true; defender.Hand.AddRange(Kings()); Player calledPlayer = dealingService.AttackerCallsKing(attacker); Assert.That(players.Count(x => x.Attacker is false), Is.EqualTo(3)); Assert.That(defender, Is.SameAs(calledPlayer)); }