コード例 #1
0
        //checks that when you select a name from the list it actually is selecting the care you chose
        public void TestSelectedCard()
        {
            var cards            = PokemonRepo.GetAllPokemonCards();
            PokemonViewModel pvm = new PokemonViewModel();

            Assert.AreEqual("Growlithe", pvm.SelectedPokemon.Name);
        }
コード例 #2
0
        //tests that the chosen pokemons attacks are actually that pokemons attacks
        public void TestAttack()
        {
            var cards            = PokemonRepo.GetAllPokemonCards();
            PokemonViewModel pvm = new PokemonViewModel();

            pvm.SelectedPokemon = cards[0];

            Assert.AreEqual("Flare", pvm.SelectedPokemon.Attacks[0].Name);
        }
コード例 #3
0
        //checks that the search funcionality is working as expected
        public void TestFilteringCards()
        {
            PokemonViewModel pvm = new PokemonViewModel();
            var cards            = PokemonRepo.GetAllPokemonCards();

            pvm.Filter = "Charizard";
            pvm.PerformFiltering();

            Assert.IsTrue(cards.Count == 1);
        }
コード例 #4
0
        //checks that we have pulled all cards from api
        public void GetAllPokemonCards_GetsAllCards()
        {
            var cards     = PokemonRepo.GetAllPokemonCards();
            var firstCard = cards[0];
            var name      = firstCard.Name;

            Assert.IsTrue(cards.Count > 20);
            Assert.IsNotNull(firstCard);
            Assert.IsNotNull(name);
        }
コード例 #5
0
 public HomeController(ILogger <HomeController> logger, HomeRepo hrepo, PokemonRepo prepo)
 {
     _logger          = logger;
     this.homeRepo    = hrepo;
     this.pokemonRepo = prepo;
 }
コード例 #6
0
 public PokemonController(PokemonRepo pRepo, SoortRepo sRepo, AanvalRepo aRepo)
 {
     this.pokemonRepo = pRepo;
     this.soortRepo   = sRepo;
     this.aanvalRepo  = aRepo;
 }