public void Validate_PlayerIsCurrent_ReturnsFalse() { GoFishGame game = GameProvider.Game; Player player = game.Players[0]; GiveCardsGameAction ga = new GiveCardsGameAction(new HashSet <Card>(player.Cards.Take(1)), player); Game.Lib.Result result = ga.Validate(game); Assert.IsFalse(result.Success); }
public void Validate_PlayerDoesNotHaveCard_ReturnsFalse() { GoFishGame game = GameProvider.Game; Player player = game.Players[1]; HashSet <Card> cards = new HashSet <Card>(player.Cards.Skip(1).Append(game.Deck.First())); GiveCardsGameAction ga = new GiveCardsGameAction(cards, player); Game.Lib.Result result = ga.Validate(game); Assert.IsFalse(result.Success); }
public void Validate_PlayerIsNotcurrent_ReturnsFalse() { GoFishGame game = GameProvider.Game; Player from = game.Players[1]; Player to = game.Players[2]; PassTurnGameAction ga = new PassTurnGameAction(from, to); Game.Lib.Result result = ga.Validate(game); Assert.IsFalse(result.Success); }
public void Validate_NotallOfSameCollection_ReturnsFalse() { GoFishGame game = GameProvider.Game; game.RuleSet.GiveCardBehaviour = GiveCardBehaviour.AllOfCollection; Player player = game.Players[1]; GiveCardsGameAction ga = new GiveCardsGameAction(player.Cards, player); Game.Lib.Result result = ga.Validate(game); Assert.IsFalse(result.Success); }
public void Validate_ValidSingle_ReturnsTrue() { GoFishGame game = GameProvider.Game; game.RuleSet.GiveCardBehaviour = GiveCardBehaviour.Single; Player player = game.Players[1]; HashSet <Card> cards = new HashSet <Card>(player.Cards.Where(c => c.Collection == "C4").Take(1)); GiveCardsGameAction ga = new GiveCardsGameAction(cards, player); Game.Lib.Result result = ga.Validate(game); Assert.IsTrue(result.Success); }
public void Validate_AllOfCollectionNotAllGiven_ReturnsFalse() { GoFishGame game = GameProvider.Game; game.RuleSet.GiveCardBehaviour = GiveCardBehaviour.AllOfCollection; Player player = game.Players[1]; HashSet <Card> cards = new HashSet <Card>(player.Cards.Where(c => c.Collection.Equals("C4")).Take(1)); GiveCardsGameAction ga = new GiveCardsGameAction(cards, player); Game.Lib.Result result = ga.Validate(game); Assert.IsFalse(result.Success); }
public void Validate_ClockwiseValid_ReturnsTrue() { GoFishGame game = GameProvider.Game; game.RuleSet.TurnBehaviour = TurnBehaviour.ClockWise; Player from = game.CurrentPlayer; Player to = game.NextPlayer; PassTurnGameAction ga = new PassTurnGameAction(from, to); Game.Lib.Result result = ga.Validate(game); Assert.IsTrue(result.Success); }
public void Validate_LastAskedPlayerIsSelf_ReturnsFalse() { GoFishGame game = GameProvider.Game; game.RuleSet.TurnBehaviour = TurnBehaviour.LastAskedPlayer; Player from = game.CurrentPlayer; Player to = from; PassTurnGameAction ga = new PassTurnGameAction(from, to); Game.Lib.Result result = ga.Validate(game); Assert.IsFalse(result.Success); }
public void Validate_LastAskedPlayerHasNoCards_ReturnsFalse() { GoFishGame game = GameProvider.Game; game.RuleSet.TurnBehaviour = TurnBehaviour.LastAskedPlayer; Player from = game.CurrentPlayer; Player to = game.Players[2]; to.Cards = new HashSet <Card>(); PassTurnGameAction ga = new PassTurnGameAction(from, to); Game.Lib.Result result = ga.Validate(game); Assert.IsFalse(result.Success); }
public void Validate_LastAskedPlayerNotInTheGame_ReturnsFalse() { GoFishGame game = GameProvider.Game; game.RuleSet.TurnBehaviour = TurnBehaviour.LastAskedPlayer; Player from = game.CurrentPlayer; Player to = new Player(Guid.NewGuid(), "Test") { Cards = CardProvider.HashSetCards }; PassTurnGameAction ga = new PassTurnGameAction(from, to); Game.Lib.Result result = ga.Validate(game); Assert.IsFalse(result.Success); }