public void HoursEntryFutureDateSetsValidationStatusNone() { Case c = getTimeOverlapTestCaseStub(); var hoursToTest = new CaseAuthorizationHours() { Date = DateTime.Now.AddDays(1), TimeIn = new DateTime(2016, 7, 2, 10, 30, 0), TimeOut = new DateTime(2016, 7, 2, 11, 30, 0), Service = new Service() { ID = 0 }, Notes = "fake notes", Provider = new CaseProvider() { Type = new Domain.Providers.ProviderType() { ID = 0 } } }; var resolver = new HoursEntryResolver(c, hoursToTest, _caseService); resolver.Resolve(); Assert.IsTrue(resolver.PassingStatus == HoursEntryResolver.ValidationResultStatus.None); }
public void HoursEntryTimeInOutDatePartsMatchDateProperty() { Case c = getTimeOverlapTestCaseStub(); var hoursToTest = new CaseAuthorizationHours() { Date = DateTime.Now.AddDays(-2), TimeIn = new DateTime(2011, 7, 2, 10, 30, 0), TimeOut = new DateTime(2011, 7, 2, 11, 30, 0), Service = new Service() { ID = 0 }, Notes = "fake notes", Provider = new CaseProvider() { Type = new Domain.Providers.ProviderType() { ID = 0 } } }; var resolver = new HoursEntryResolver(c, hoursToTest, _caseService); resolver.Resolve(); Assert.IsTrue(hoursToTest.TimeIn.Date == hoursToTest.Date); Assert.IsTrue(hoursToTest.TimeOut.Date == hoursToTest.Date); }
public void HoursEntryBillablePayableRoundNearestQuarter() { Case c = getTimeOverlapTestCaseStub(); var hoursToTest = new CaseAuthorizationHours() { CaseID = 420, Date = DateTime.Now.AddDays(-2), TimeIn = new DateTime(2011, 7, 2, 10, 02, 0), TimeOut = new DateTime(2011, 7, 2, 11, 28, 0), Service = new Service() { ID = 0 }, Notes = "fake notes", Provider = new CaseProvider() { Type = new Domain.Providers.ProviderType() { ID = 0 } } }; var resolver = new HoursEntryResolver(c, hoursToTest, _caseService); resolver.Resolve(); Assert.IsTrue(hoursToTest.BillableHours == 1.5); Assert.IsTrue(hoursToTest.PayableHours == 1.5); }