Example #1
0
        private void SetupFixedDate(DateTime date)
        {
            var testSystemData = new TestSystemData();

            testSystemData.ToggleFixedCurrentDateUsage(true);
            testSystemData.UpdateFixedCurrentDate(date);

            A.CallTo(() => systemDataDataAccess.Get()).Returns(testSystemData);
        }
        public async void UsingFixedDate_AndDateIsWithinWindow_NoValidationError()
        {
            var systemData = new TestSystemData();
            systemData.UpdateFixedCurrentDate(new DateTime(2016, 01, 01, 0, 0, 0));
            systemData.ToggleFixedCurrentDateUsage(true);

            A.CallTo(() => systemDataDataAccess.Get())
                .Returns(systemData);

            var windowStart = new DateTime(2016, 1, 1, 0, 0, 0);
            var windowEnd = new DateTime(2016, 1, 2, 0, 0, 0);

            A.CallTo(() => quarterWindowFactory.GetQuarterWindow(A<Quarter>._))
                .Returns(new QuarterWindow(windowStart, windowEnd));

            var result = await
                SubmissionWindowClosed()
                    .Validate(new Quarter(2016, QuarterType.Q1));

            Assert.Empty(result);
        }
Example #3
0
        public async void UsingFixedDate_AndDateIsWithinWindow_NoValidationError()
        {
            var systemData = new TestSystemData();

            systemData.UpdateFixedCurrentDate(new DateTime(2016, 01, 01, 0, 0, 0));
            systemData.ToggleFixedCurrentDateUsage(true);

            A.CallTo(() => systemDataDataAccess.Get())
            .Returns(systemData);

            var windowStart = new DateTime(2016, 1, 1, 0, 0, 0);
            var windowEnd   = new DateTime(2016, 1, 2, 0, 0, 0);

            A.CallTo(() => quarterWindowFactory.GetQuarterWindow(A <Quarter> ._)).Returns(new QuarterWindow(windowStart, windowEnd, QuarterType.Q1));

            var result = await
                         SubmissionWindowClosed()
                         .Validate(new Quarter(2016, QuarterType.Q1));

            Assert.Empty(result);
        }