Exemplo n.º 1
0
        public async void Should_Return_Forecast_By_Id()
        {
            // arrange
            var expected = fixture.forecastList.Where(forecast => forecast.Id == 1).FirstOrDefault();

            // act
            var result = await controller.GetOne(1);

            // assert
            Assert.IsType <ActionResult <WeatherForecast> >(result);
            Assert.Equal(expected, result.Value); // Using Value since ReturnType is ActionResult<WeatherForecast>, so we need to access the value
        }
Exemplo n.º 2
0
        public void GetReturn()
        {
            var val = controller.GetOne(1);

            Assert.Equal("Something else", val.Value);
        }