Example #1
0
        public void Map_GivenSource_GivenQuarterWindow_QuarterWindowShouldNotBeNull()
        {
            var quarterWindow = new EA.Weee.Domain.DataReturns.QuarterWindow(new DateTime(2019, 4, 1), new DateTime(2020, 3, 16), QuarterType.Q1);

            var source = new ReturnQuarterWindow(GetReturn(), quarterWindow,
                                                 null, null, null, null, null, null, A.Fake <List <ReturnScheme> >(), A.Fake <List <ReturnReportOn> >(), A.Dummy <DateTime>());

            var result = map.Map(source);

            result.QuarterWindow.Should().NotBeNull();
        }
        public async Task GetReturnData_GivenReturnForSummaryAndReturnIsCreated_AatfsForOrganisationShouldBeRetrieved()
        {
            var @return       = new Return(Organisation.CreatePartnership("trading"), new Quarter(2019, QuarterType.Q1), "created", FacilityType.Aatf);
            var quarterWindow = new EA.Weee.Domain.DataReturns.QuarterWindow(DateTime.Now, DateTime.Now.AddDays(1), QuarterType.Q1);

            A.CallTo(() => quarterWindowFactory.GetQuarterWindow(@return.Quarter)).Returns(quarterWindow);
            A.CallTo(() => returnDataAccess.GetById(@return.Id)).Returns(@return);

            var result = await populatedReturn.GetReturnData(@return.Id, true);

            A.CallTo(() => fetchAatfDataAccess.FetchAatfByReturnQuarterWindow(@return)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => fetchAatfDataAccess.FetchAatfByReturnId(A <Guid> ._)).MustNotHaveHappened();
        }