コード例 #1
0
        public async Task ShouldRejectForecastReportAsBadRequestWhenTemperatureIsLessThanMinus100()
        {
            //GIVEN
            await using var driver = new AppDriver();
            await driver.StartAsync();

            //WHEN
            using var reportForecastResponse = await driver.WeatherForecastApi
                                               .WithTemperatureOf(-101)
                                               .AttemptToReportForecast();

            //THEN
            reportForecastResponse.ShouldBeRejectedAsBadRequest();
            driver.Notifications.ShouldNotIncludeAnything();
        }
コード例 #2
0
        public async Task ShouldAllowRetrievingReportedForecast()
        {
            //GIVEN
            await using var driver = new AppDriver();
            await driver.StartAsync();

            await driver.WeatherForecastApi.ReportForecast();

            //WHEN
            using var retrievedForecast = await driver.WeatherForecastApi.GetReportedForecast();

            //THEN
            await retrievedForecast.ShouldBeTheSameAsReported();

            //not really part of the scenario...
            driver.Notifications.ShouldIncludeNotificationAboutReportedForecast();
        }