Пример #1
0
 public void TestColculateBusinessDaysFunc()
 {
     ReportModel model = new ReportModel(controller);
     DateTime start = new DateTime(2018, 04, 19);
     DateTime end = new DateTime(2018, 04, 26);
     Assert.AreEqual(6, model.ColculateBusinessDays(end, start));
     start = new DateTime(2018, 04, 20);
     end = new DateTime(2018, 04, 25);
     Assert.AreEqual(4, model.ColculateBusinessDays(end, start));
     start = new DateTime(2018, 04, 21);
     end = new DateTime(2018, 04, 25);
     Assert.AreEqual(4, model.ColculateBusinessDays(end, start));
     start = new DateTime(2018, 03, 1);
     end = new DateTime(2018, 03, 31);
     Assert.AreEqual(21, model.ColculateBusinessDays(end, start));
     start = new DateTime(2018, 2, 1);
     end = new DateTime(2018, 2, 28);
     Assert.AreEqual(20, model.ColculateBusinessDays(end, start));
     start = new DateTime(2018, 1, 1);
     end = new DateTime(2018, 1, 31);
     Assert.AreEqual(23, model.ColculateBusinessDays(end, start));
     start = new DateTime(2018, 1, 6);
     end = new DateTime(2018, 1,6);
     Assert.AreEqual(0, model.ColculateBusinessDays(end, start));
     start = new DateTime(2018, 1, 6);
     end = new DateTime(2018, 1, 13);
     Assert.AreEqual(5, model.ColculateBusinessDays(end, start));
     start = new DateTime(2018, 1, 5);
     end = new DateTime(2018, 1, 6);
     Assert.AreEqual(0, model.ColculateBusinessDays(end, start));
     start = new DateTime(2018, 1, 17);
     end = new DateTime(2018, 1, 31);
     Assert.AreEqual(11, model.ColculateBusinessDays(end, start));
 }