Ejemplo n.º 1
0
        public void Test_SelectShortTermEntry_SecondOne()
        {
            //Arrange
            IWeatherUtils weatherUtils = new WeatherUtils(new SystemClock());

            var forecast = new ForecastShortTerm();

            var entry1 = new ForecastShortTermEntry();

            entry1.UnixTimestamp = 978361200; //2001/01/01 15:00:00
            var entry2 = new ForecastShortTermEntry();

            entry2.UnixTimestamp = 978368400; //2001/01/01 17:00:00

            forecast.Entries = new List <ForecastShortTermEntry>()
            {
                entry1, entry2
            };

            var locDetail = new LocationDetail();

            locDetail.Time = new DateTime(2001, 01, 01, 16, 0, 1); //978364801

            //Act
            var entry = weatherUtils.SelectShortTermEntry(locDetail, forecast);

            //Assert - entry2 should be selected
            Assert.AreEqual(978368400, entry.UnixTimestamp);
        }
Ejemplo n.º 2
0
        public void Test_SelectLongTermEntry_Argument2Null()
        {
            IWeatherUtils weatherUtils = new WeatherUtils(new SystemClock());

            var loc = new LocationDetail();

            weatherUtils.SelectShortTermEntry(loc, null);
        }
Ejemplo n.º 3
0
        public void Test_SelectShortTermEntry_Argument1Null()
        {
            IWeatherUtils weatherUtils = new WeatherUtils(new SystemClock());

            var fc = new ForecastShortTerm();

            weatherUtils.SelectShortTermEntry(null, fc);
        }
Ejemplo n.º 4
0
        public void Test_SelectShortTermEntry_NoEntries()
        {
            IWeatherUtils weatherUtils = new WeatherUtils(new SystemClock());

            var loc = new LocationDetail();
            var fc  = new ForecastShortTerm();

            fc.Entries = new List <ForecastShortTermEntry>();

            weatherUtils.SelectShortTermEntry(loc, fc);
        }