Мой модульный тест -
String xmlText = File.ReadAllText(@"C:\PrashantWorkspace\Weather.xml");
var mockFactory = new Mock<IHttpClientFactory>();
var mockHttpMessageHandler = new Mock<HttpMessageHandler>();
mockHttpMessageHandler.Protected()
.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
.ReturnsAsync(new HttpResponseMessage
{
StatusCode = HttpStatusCode.OK,
Content = new StringContent(xmlText, Encoding.UTF8, "application/xml"),
});
var client = new HttpClient(mockHttpMessageHandler.Object);
mockFactory.Setup(_ => _.CreateClient(It.IsAny<string>())).Returns(client);
WeatherController wController = new WeatherController(_logger.Object, _configuration.Object, mockFactory.Object);
var result = await wController.Get("1", "2", false);
Assert.IsType<OkObjectResult>(result);
Как я могу пройти еще один xml, который будет использоваться вторым вызовом API в моем контроллере?