public void CheckShortMonth() { dayForecast = new Models.Services.DayForecastService(DateTime.Now, DateTime.Now.AddMonths(6), configuration, dapperRepositoryMock); var shortmonth = DateTime.Now.ToString("MMM"); Assert.AreEqual(shortmonth, dayForecast.DayForecastCollection.First().ShortMonth); }
public void CheckDaysHoursMinutesForSingleDay() { dayForecast = new Models.Services.DayForecastService(DateTime.Now, DateTime.Now.AddMonths(6), configuration, dapperRepositoryMock); var singleDay = dayForecast.DayForecastCollection.First(); Assert.AreEqual(configuration.DefaultHoursInDay, singleDay.TotalHours); Assert.AreEqual(configuration.DefaultHoursInDay * 60, singleDay.TotalMinutes); Assert.AreEqual((configuration.DefaultHoursInDay * 60) * 60, singleDay.TotalSeconds); }
public void CheckWeekForCorrectDays() { dayForecast = new Models.Services.DayForecastService(DateTime.Now, DateTime.Now.AddMonths(6), configuration, dapperRepositoryMock); List <string> days = new List <string> { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" }; var daysToCompare = dayForecast.WeekDayForecastCollection.First().Select(tv => tv.FullDayOfTheWeek).ToList(); CollectionAssert.AreEqual(daysToCompare, days); }
public IEnumerable<string> GetWeek() { dayforecast = new Models.Services.DayForecastService(DateTime.Now, DateTime.Now.AddMonths(6), new Models.DayForecastConfiguration { DayEndOfWeek = "Friday", DayStartOfWeek = "Monday", DefaultHoursInDay = 8, WeekDaysToExclude = new List<string> { "Saturday", "Sunday" } }, new DapperRepository<DayForecast>(new SqlConnection(ConfigurationManager.ConnectionStrings["DevForecast"].ConnectionString))); return dayforecast.Week; }
public IEnumerable <string> GetWeek() { dayforecast = new Models.Services.DayForecastService(DateTime.Now, DateTime.Now.AddMonths(6), new Models.DayForecastConfiguration { DayEndOfWeek = "Friday", DayStartOfWeek = "Monday", DefaultHoursInDay = 8, WeekDaysToExclude = new List <string> { "Saturday", "Sunday" } }, new DapperRepository <DayForecast>(new SqlConnection(ConfigurationManager.ConnectionStrings["DevForecast"].ConnectionString))); return(dayforecast.Week); }
public void CheckIfDaysAreExcluded() { dayForecast = new Models.Services.DayForecastService(DateTime.Now, DateTime.Now.AddMonths(6), configuration, dapperRepositoryMock); Assert.IsFalse(dayForecast.DayForecastCollection.Where(df => df.FullDayOfTheWeek == "Saturday").Any()); Assert.IsFalse(dayForecast.DayForecastCollection.Where(df => df.FullDayOfTheWeek == "Sunday").Any()); }
public void CheckShortDay() { dayForecast = new Models.Services.DayForecastService(DateTime.Now, DateTime.Now.AddMonths(6), configuration, dapperRepositoryMock); Assert.AreEqual("Mon", dayForecast.DayForecastCollection.First().ShortDayOfTheWeek); }
public void CheckMonthDifference() { dayForecast = new Models.Services.DayForecastService(DateTime.Now, DateTime.Now.AddMonths(6), configuration, dapperRepositoryMock); Assert.IsTrue(dayForecast.MonthDifference == 6); }
public void CheckIfForecastCollectionIsNotEmpty() { dayForecast = new Models.Services.DayForecastService(DateTime.Now, DateTime.Now.AddMonths(6), configuration, dapperRepositoryMock); Assert.IsTrue(dayForecast.DayForecastCollection.Count > 0); }
public void CheckTotalDays() { dayForecast = new Models.Services.DayForecastService(DateTime.Now, DateTime.Now.AddMonths(6), configuration, dapperRepositoryMock); Assert.IsTrue(dayForecast.TotalDays == dayForecast.DayForecastCollection.Count); }
public void CheckStartDateDaysInMonth() { dayForecast = new Models.Services.DayForecastService(DateTime.Now, DateTime.Now.AddMonths(6), configuration, dapperRepositoryMock); Assert.IsTrue(dayForecast.StartDaysInMonth == 30); }
public void CheckWeekSingularDays() { //need an array of days that only repeats once, sort of like column headings dayForecast = new Models.Services.DayForecastService(DateTime.Now, DateTime.Now.AddMonths(6), configuration, dapperRepositoryMock); Assert.IsTrue(dayForecast.Week.Any()); }