Ejemplo n.º 1
0
        public void Test_AvailableForShortTermForecast_TripNull()
        {
            //Arrange
            DateTime dtNow        = new DateTime(2014, 12, 6, 18, 40, 0);
            var      weatherUtils = new WeatherUtils(new MockClock(dtNow));

            //Act
            weatherUtils.AvailableForShortTermForecast(null);
        }
Ejemplo n.º 2
0
        public void Test_AvailableForShortTermForecast_UnderBy_15Minutes()
        {
            //Arrange
            var dtNow   = new DateTime(2014, 10, 1, 15, 0, 0);
            var dtStart = new DateTime(2014, 10, 5, 23, 30, 0);

            var trip = new Trip();

            trip.StartDateTime = dtStart;
            trip.Duration      = 900; // 15 minutes

            IClock        staticClock  = new MockClock(dtNow);
            IWeatherUtils weatherUtils = new WeatherUtils(staticClock);

            //Act
            bool available = weatherUtils.AvailableForShortTermForecast(trip);

            //Assert
            Assert.IsTrue(available);
        }
Ejemplo n.º 3
0
        public void Test_AvailableForShortTermForecast_True()
        {
            //Arrange
            var dtNow   = new DateTime(2014, 10, 1, 15, 0, 0);
            var dtStart = new DateTime(2014, 10, 4, 17, 0, 0);

            var trip = new Trip();

            trip.StartDateTime = dtStart;
            trip.Duration      = 3600; // one hour

            IClock        staticClock  = new MockClock(dtNow);
            IWeatherUtils weatherUtils = new WeatherUtils(staticClock);

            //Act
            bool available = weatherUtils.AvailableForShortTermForecast(trip);

            //Assert
            Assert.IsTrue(available);
        }