public void CalculationBLLTest_GetFollowUpService_WrongDay() { var estw = new ESTW("ID", "Name", string.Empty, null); estw.Time = new LeibitTime(eDaysOfService.Saturday, 14, 45); var train = new Train(1); new Schedule(train, new LeibitTime(14, 56), null, null, new List <eDaysOfService>(), eScheduleDirection.Unknown, eHandling.Destination, string.Empty); var relation = new TrainRelation(2); relation.Days.Add(eDaysOfService.Monday); relation.Days.Add(eDaysOfService.Tuesday); relation.Days.Add(eDaysOfService.Wednesday); relation.Days.Add(eDaysOfService.Thursday); relation.Days.Add(eDaysOfService.Friday); train.FollowUpServices.Add(relation); var bll = new CalculationBLL(); var result = bll.GetFollowUpService(train, estw); Assert.IsTrue(result.Succeeded); Assert.IsNull(result.Result); }
public void CalculationBLLTest_GetFollowUpService_SimpleCase() { var estw = new ESTW("ID", "Name", string.Empty, null); var train = new Train(1); var relation = new TrainRelation(2); relation.Days.Add(eDaysOfService.Monday); relation.Days.Add(eDaysOfService.Tuesday); relation.Days.Add(eDaysOfService.Wednesday); relation.Days.Add(eDaysOfService.Thursday); relation.Days.Add(eDaysOfService.Friday); relation.Days.Add(eDaysOfService.Saturday); relation.Days.Add(eDaysOfService.Sunday); train.FollowUpServices.Add(relation); var bll = new CalculationBLL(); var result = bll.GetFollowUpService(train, estw); Assert.IsTrue(result.Succeeded); Assert.AreEqual(2, result.Result); }
public void CalculationBLLTest_GetFollowUpService_BeforeMidnight() { var estw = new ESTW("ID", "Name", string.Empty, null); estw.Time = new LeibitTime(eDaysOfService.Thursday, 23, 55); var train = new Train(0); new Schedule(train, new LeibitTime(0, 5), null, null, new List <eDaysOfService>(), eScheduleDirection.Unknown, eHandling.Destination, string.Empty); var relation = new TrainRelation(1); relation.Days.Add(eDaysOfService.Monday); train.FollowUpServices.Add(relation); relation = new TrainRelation(2); relation.Days.Add(eDaysOfService.Tuesday); train.FollowUpServices.Add(relation); relation = new TrainRelation(3); relation.Days.Add(eDaysOfService.Wednesday); train.FollowUpServices.Add(relation); relation = new TrainRelation(4); relation.Days.Add(eDaysOfService.Thursday); train.FollowUpServices.Add(relation); relation = new TrainRelation(5); relation.Days.Add(eDaysOfService.Friday); train.FollowUpServices.Add(relation); var bll = new CalculationBLL(); var result = bll.GetFollowUpService(train, estw); Assert.IsTrue(result.Succeeded); Assert.AreEqual(5, result.Result); }