コード例 #1
0
        public void ShouldSetChosenPokemonAsCurrent()
        {
            ITrainer trainer = TrainerFactory.CreateTrainer <Blue>();

            trainer?.PokemonTeam?.FirstOrDefault()?.SetAsCurrent();
            Assert.True(trainer.PokemonTeam?.FirstOrDefault()?.Current);
        }
コード例 #2
0
        public void TrainerShouldNotHaveAnyPokemonLeftToBattle()
        {
            ITrainer trainer = TrainerFactory.CreateTrainer <Player>();

            trainer?.PokemonTeam?.ForEach(pkmn => pkmn?.SetAsFainted());
            Assert.False(trainer?.HasAvailablePokemon());
        }
コード例 #3
0
        public void PlayerShouldNotHaveDialogues()
        {
            ITrainer player = TrainerFactory.CreateTrainer <Player>();

            Assert.Throws <NotImplementedException>(() => player?.ShowTrainerDialogue());
            Assert.Throws <NotImplementedException>(() => player?.ShowFinalDialogueForLoss());
            Assert.Throws <NotImplementedException>(() => player?.ShowFinalDialogueForVictory());
        }
コード例 #4
0
 static void Main()
 {
     try
     {
         ITrainer player    = TrainerFactory.CreateTrainer <Player>();
         var      mainStory = new MainStory(player);
         mainStory.BeginStory();
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Something bad happened in the game! Please report the error. Error: {ex.Message} \n Error's StackTrace: {ex.StackTrace}");
     }
 }
コード例 #5
0
 public void TrainerRedCreationShouldNotReturnNull()
 => Assert.NotNull(TrainerFactory.CreateTrainer <Red>());
コード例 #6
0
 public void TrainerLanceCreationShouldNotReturnNull()
 => Assert.NotNull(TrainerFactory.CreateTrainer <Lance>());
コード例 #7
0
 public void TrainerMaryAnnCreationShouldNotReturnNull()
 => Assert.NotNull(TrainerFactory.CreateTrainer <MaryAnn>());
コード例 #8
0
 public void TrainerBrunoCreationShouldNotReturnNull()
 => Assert.NotNull(TrainerFactory.CreateTrainer <Bruno>());
コード例 #9
0
 public void TrainerPlayerCreationShouldNotReturnNull()
 => Assert.NotNull(TrainerFactory.CreateTrainer <Player>());
コード例 #10
0
        public void EnemyTrainerShouldNotHaveAnyItems()
        {
            ITrainer brock = TrainerFactory.CreateTrainer <Brock>();

            Assert.True(brock?.Items == null);
        }