コード例 #1
0
        private void VerifyForecastRow(int rowNum)
        {
            var row       = WeatherPage.ForecastDay(rowNum);
            int collIndex = rowNum - 1;

            Assert.AreEqual(ExpectedData.Edinburgh5Day["MaxTemp"][collIndex], row.MaxTemp.Text, "Max Temperature was not updated.");
            Assert.AreEqual(ExpectedData.Edinburgh5Day["MinTemp"][collIndex], row.MinTemp.Text, "Min Temperature was not updated.");
            Assert.AreEqual(ExpectedData.Edinburgh5Day["WindSpeed"][collIndex], row.WindSpeed.Text, "Wind Speed was not updated.");
            Assert.AreEqual(ExpectedData.Edinburgh5Day["Rainfall"][collIndex], row.RainFall.Text, "Rain was not updated.");
            Assert.AreEqual(ExpectedData.Edinburgh5Day["Pressure"][collIndex], row.Pressure.Text, "Pressure was not updated.");
        }
コード例 #2
0
        [TestMethod] //This will expect actual integration to service
        public void ForecastShowsNext5Days()
        {
            //Setup
            var now = DateTime.Now;

            //Assert
            for (int i = 0; i < 5; i++)
            {
                string      expectedWeekDay = now.AddDays(i).DayOfWeek.ToString().Substring(0, 3);
                int         expectedDate    = now.AddDays(i).Day;
                ForecastRow forecastRow     = WeatherPage.ForecastDay(i + 1);
                Assert.AreEqual(expectedWeekDay, forecastRow.DayOfWeek.Text, "Day of week is incorrect in row " + i);
                Assert.AreEqual(expectedDate, forecastRow.DayOfMonth.Text, "Day of month is incorrect in row " + i);
            }
        }
コード例 #3
0
        public void DetailedForecastIsShownWhenClickingOnToday()
        {
            //Setup
            int rowNum   = 1;
            var todayRow = WeatherPage.ForecastDay(rowNum);

            //Execute
            WeatherPage.UpdateCity("Edinburgh");
            todayRow.DayOfWeek.Click();

            //Assert
            for (int i = 1; i <= 4; i++)
            {
                VerifyForecastDetail(rowNum, i);
            }
        }
コード例 #4
0
 public void Only5DaysExistInForecast()
 {
     //Assert
     Assert.IsFalse(WeatherPage.ForecastDay(6).Exists());
 }