public void SqlDatesGetExecutedProperly() { var tr = _servicesFixture.InsertRequirement(months: 12); var actualDate = _servicesFixture.DbConnection.TrainingRequirements.Select(requirement => Sql.AsSql(new DateTime(2018, 3, 1).AddMonths(requirement.RenewMonthsCount / -2)) ).First(); actualDate.ShouldBe(new DateTime(2018, 3, 1).AddMonths(tr.RenewMonthsCount / -2)); }
public void GetsResults() { var tr = _sf.InsertRequirement(); var expectedTraining = _sf.InsertTraining(tr.Id, new DateTime(2018, 3, 1)); var training = _repo.StaffTrainingWithRequirements.ToArray(); training.ShouldNotBeEmpty(); training.ShouldHaveSingleItem(); training.ShouldContain(t => t.Id == expectedTraining.Id); var actualTraining = training.Single(); actualTraining.CompletedDate.ShouldBe(expectedTraining.CompletedDate); }