public void Bounce_EvolvedPokemon_OnlyBasic() { var effect = new BouncePokemonEffect() { OnlyBasic = true, ShuffleIntoDeck = false, ReturnAttachedToHand = true, TargetingMode = TargetingMode.OpponentActive }; var opponent = new Player(); var pokemon = new PokemonCard(opponent) { Name = "Pokemon1", Stage = 0, Hp = 100 }; var evolution = new PokemonCard(opponent) { Name = "Evo", Stage = 1, EvolvesFrom = "Pokemon1", Hp = 100 }; opponent.ActivePokemonCard = evolution; pokemon.Evolve(evolution); var other = new PokemonCard(opponent); opponent.BenchedPokemon.Add(other); var sub = Substitute.For <INetworkPlayer>(); sub.SendAndWaitForResponse <CardListMessage>(Arg.Any <NetworkMessage>()).ReturnsForAnyArgs(new CardListMessage { Cards = new List <NetworkId> { other.Id } }); opponent.SetNetworkPlayer(sub); var game = new GameField(); game.AddPlayer(new Player() { Id = NetworkId.Generate() }); game.AddPlayer(opponent); opponent.Id = NetworkId.Generate(); effect.Process(game, game.Players[0], opponent, null); Assert.Single(opponent.Hand); Assert.Equal(pokemon.Id, opponent.Hand[0].Id); Assert.Single(opponent.DiscardPile); Assert.Equal(evolution.Id, opponent.DiscardPile[0].Id); }
public void ScoopUp_TargetIsEvolved() { var effect = new BouncePokemonEffect { OnlyBasic = true, TargetingMode = TargetingMode.YourPokemon, ReturnAttachedToHand = false, ShuffleIntoDeck = false }; var player = new Player(); var activePokemon = new PokemonCard() { Stage = 1, Owner = player, Hp = 100 }; var basicPokemon = new PokemonCard(); var targetPokemon = new PokemonCard() { Stage = 1, AttachedEnergy = new List <EnergyCard> { new EnergyCard(), new EnergyCard() }, Owner = player, EvolvedFrom = basicPokemon, Hp = 100 }; var sub = Substitute.For <INetworkPlayer>(); sub.SendAndWaitForResponse <CardListMessage>(Arg.Any <NetworkMessage>()).ReturnsForAnyArgs(new CardListMessage { Cards = new List <NetworkId> { targetPokemon.Id } }); player.SetNetworkPlayer(sub); player.ActivePokemonCard = activePokemon; player.BenchedPokemon.Add(targetPokemon); var game = new GameField(); game.AddPlayer(player); game.AddPlayer(new Player()); game.ActivePlayerIndex = 0; effect.Process(game, player, game.NonActivePlayer, null); Assert.Equal(0, player.BenchedPokemon.Count); Assert.Equal(3, player.DiscardPile.Count); Assert.Single(player.Hand); Assert.Equal(basicPokemon.Id, player.Hand[0].Id); }
public void CardShuffledIntoDeck() { var effect = new BouncePokemonEffect() { ShuffleIntoDeck = true, TargetingMode = TargetingMode.OpponentActive }; var opponent = new Player(); var pokemon = new PokemonCard(opponent) { AttachedEnergy = new List <EnergyCard> { new EnergyCard() }, Hp = 100 }; opponent.ActivePokemonCard = pokemon; var other = new PokemonCard(opponent); opponent.BenchedPokemon.Add(other); var sub = Substitute.For <INetworkPlayer>(); sub.SendAndWaitForResponse <CardListMessage>(Arg.Any <NetworkMessage>()).ReturnsForAnyArgs(new CardListMessage { Cards = new List <NetworkId> { other.Id } }); opponent.SetNetworkPlayer(sub); var game = new GameField(); game.AddPlayer(new Player() { Id = NetworkId.Generate() }); game.AddPlayer(opponent); opponent.Id = NetworkId.Generate(); effect.Process(game, game.Players[0], opponent, null); Assert.Equal(2, opponent.Deck.Cards.Count); Assert.Equal(other, opponent.ActivePokemonCard); }