public async Task ShouldGetAllWeatherForecasts() { // Arrange var getWeatherForecastsRequest = new GeTransactionsRequest { Days = 10 }; //Act GetWeatherForecastResponse getWeatherForecastsResponse = await Mediator.Send(getWeatherForecastsRequest); //Assert getWeatherForecastsResponse.WeatherForecasts.Count.ShouldBe(10); }
public override async Task <Unit> Handle ( FetchWeatherForecastsAction aFetchWeatherForecastsAction, CancellationToken aCancellationToken ) { var getWeatherForecastsRequest = new GeTransactionsRequest { Days = 10 }; GetWeatherForecastResponse getWeatherForecastsResponse = await HttpClient.PostJsonAsync <GetWeatherForecastResponse>(GeTransactionsRequest.Route, getWeatherForecastsRequest); WeatherForecastsState._WeatherForecasts = getWeatherForecastsResponse.WeatherForecasts; return(Unit.Value); }