public void Setup() { translateAPIService = new TranslateAPIService(); pokemonAPIService = new PokemonAPIService(); pokemonService = new PokemonService(translateAPIService, pokemonAPIService, Mapper); pokemonController = new PokemonController(pokemonService); }
public async Task TestValidPokemonNameReturnsSuccess() { PokemonAPIService pokemonAPIService = new PokemonAPIService(); var response = await pokemonAPIService.GetPokemanDetailsAsync("charizard"); Assert.That(response, !Is.Null); }
public void TestNonExistantPokemonSpeciesReturnsApplicationException() { PokemonAPIService pokemonAPIService = new PokemonAPIService(); ApplicationException ex = Assert.ThrowsAsync <ApplicationException>(async() => await pokemonAPIService.GetPokemanSpeciesDetailsAsync($"{pokemonSpeciesPath}/NonExistantPokemonSpecies")); Assert.That(ex.Message, Is.EqualTo("Not Found")); }
public async Task TestEmptyPokemonNameReturnsNoRecord() { PokemonAPIService pokemonAPIService = new PokemonAPIService(); var response = await pokemonAPIService.GetPokemanDetailsAsync(string.Empty); Assert.That(response.Id, Is.EqualTo(0)); }
public async Task TestValidPokemonSpeciesReturnsSuccess() { PokemonAPIService pokemonAPIService = new PokemonAPIService(); var response = await pokemonAPIService.GetPokemanSpeciesDetailsAsync($"{pokemonSpeciesPath}/6"); Assert.That(response.Id, Is.EqualTo(6)); }