Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }