public async Task GetPokemonData_InvalidInput() { //initialize test var pokemonName = "fakepokemon"; var controller = new PokemonController(); //execute var result = await controller.GetPokemonDataAsync(pokemonName) as NegotiatedContentResult <string>; //assert Assert.IsNotNull(result); }
public async Task GetPokemonData_ValidInput() { //initialize test var pokemonName = "pikachu"; var controller = new PokemonController(); //execute var result = await controller.GetPokemonDataAsync(pokemonName) as OkNegotiatedContentResult <TranslatedPokemonResponseModel>; //assert Assert.IsNotNull(result); Assert.AreEqual(pokemonName, result.Content.name); }