public async Task GivenPokemonName_WhenGetPokemonWithShakespeareDescription_TheReturns200OK(string pokemonName) { // When var response = (await _sut.GetPokemonWithShakespeareDescriptionAsync(pokemonName)) as ObjectResult; // Then Assert.Equal((int)HttpStatusCode.OK, response.StatusCode); Assert.NotNull(((GetPokemonResponse)response.Value).Description); }
public async Task GivenPokemonName_WhenGetPokemonWithShakespeareDescription_Then200OKIsReturned_WithTranslatedDescription( string pokemonName, string description, string translatedDescription) { // given _pokespearServiceMock.Setup(x => x.GetPokemonDescriptionAsync(pokemonName)).ReturnsAsync(description); _pokespearServiceMock.Setup(x => x.GetShakespeareTranslationAsync(description)) .ReturnsAsync(translatedDescription); // when var result = (ObjectResult)await _sut.GetPokemonWithShakespeareDescriptionAsync(pokemonName); var response = (GetPokemonResponse)result.Value; // then Assert.Equal((int)HttpStatusCode.OK, result.StatusCode); Assert.Equal(pokemonName, response.Name); Assert.Equal(translatedDescription, response.Description); }