public void CalendarYearCalendarMonthRule03PassesDatesInTheContractPeriod()
        {
            var allocation = new ContractAllocationCacheModel
            {
                EndDate = new DateTime(2017, 11, 01)
            };

            var mapper = new Mock <IFcsCodeMappingHelper>();

            mapper.Setup(
                x => x.GetFcsDeliverableCode(It.IsAny <SupplementaryDataModel>(), It.IsAny <CancellationToken>()))
            .Returns(3);

            var referenceRepo = new Mock <IReferenceDataService>();

            referenceRepo
            .Setup(x => x.GetContractAllocation(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <CancellationToken>(), It.IsAny <int?>()))
            .Returns(allocation);

            var model = new SupplementaryDataModel
            {
                ConRefNumber  = "ESF-2111",
                CalendarMonth = 10,
                CalendarYear  = 2017
            };
            var rule = new CalendarYearCalendarMonthRule03(_messageServiceMock.Object, referenceRepo.Object, mapper.Object);

            Assert.True(rule.IsValid(model));
        }
        public void CalendarYearCalendarMonthRule03CatchesDatesAfterTheContractDate()
        {
            var allocation = new ContractAllocationCacheModel
            {
                EndDate = new DateTime(2017, 11, 01)
            };

            var mapper = new Mock <IFcsCodeMappingHelper>();

            mapper.Setup(
                x => x.GetFcsDeliverableCode(It.IsAny <SupplementaryDataModel>(), It.IsAny <CancellationToken>()))
            .Returns(3);

            var referenceRepo = new Mock <IReferenceDataCache>();

            referenceRepo
            .Setup(x => x.GetContractAllocation(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <CancellationToken>(), It.IsAny <long?>()))
            .Returns(allocation);

            var model = new SupplementaryDataModel
            {
                ConRefNumber  = "ESF-2111",
                CalendarMonth = 12,
                CalendarYear  = 2017
            };
            var rule = new CalendarYearCalendarMonthRule03(referenceRepo.Object, mapper.Object);

            Assert.False(rule.Execute(model));
        }