public async Task GetWeatherAsync_Returns_correct_city() { // Arrange const string city = "Porto"; httpMessageHandler .Protected() .Setup <Task <HttpResponseMessage> >( "SendAsync", ItExpr.IsAny <HttpRequestMessage>(), ItExpr.IsAny <CancellationToken>()) .ReturnsAsync(new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent("{\"id\": 2735943,\"name\": \"Porto\",\"cod\": 200}"), }); // Act var weatherReport = await personalAssistant.GetWeatherAsync(city); // Assert Assert.NotNull(weatherReport); Assert.Equal(city, weatherReport.name); }