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); }
public void Test_SelectLongTermEntry_Argument2Null() { IWeatherUtils weatherUtils = new WeatherUtils(new SystemClock()); var loc = new LocationDetail(); weatherUtils.SelectShortTermEntry(loc, null); }
public void Test_SelectShortTermEntry_Argument1Null() { IWeatherUtils weatherUtils = new WeatherUtils(new SystemClock()); var fc = new ForecastShortTerm(); weatherUtils.SelectShortTermEntry(null, fc); }
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); }