public async Task GetReturnData_GivenReturnForNonSummary_MapperShouldBeCalled()
        {
            var @return                 = new Return(A.Fake <Organisation>(), A.Fake <Quarter>(), "id", A.Fake <FacilityType>());
            var quarterWindow           = new Domain.DataReturns.QuarterWindow(DateTime.MaxValue, DateTime.MaxValue, QuarterType.Q1);
            var nonObligatedValues      = new List <NonObligatedWeee>();
            var obligatedReceivedValues = new List <WeeeReceivedAmount>();
            var obligatedReusedValues   = new List <WeeeReusedAmount>();
            var obligatedSentOnValues   = new List <WeeeSentOnAmount>();
            var returnSchemes           = new List <ReturnScheme>();
            var reportsOn               = new List <ReturnReportOn>();
            var aatfs = new List <Aatf>();

            A.CallTo(() => returnDataAccess.GetById(A <Guid> ._)).Returns(@return);
            A.CallTo(() => quarterWindowFactory.GetQuarterWindow(A <Quarter> ._)).Returns(quarterWindow);
            A.CallTo(() => fetchNonObligatedWeeeDataAccess.FetchNonObligatedWeeeForReturn(A <Guid> ._)).Returns(nonObligatedValues);
            A.CallTo(() => fetchObligatedWeeeDataAccess.FetchObligatedWeeeReceivedForReturn(A <Guid> ._)).Returns(obligatedReceivedValues);
            A.CallTo(() => fetchObligatedWeeeDataAccess.FetchObligatedWeeeReusedForReturn(A <Guid> ._)).Returns(obligatedReusedValues);
            A.CallTo(() => fetchObligatedWeeeDataAccess.FetchObligatedWeeeSentOnForReturnByReturn(A <Guid> ._)).Returns(obligatedSentOnValues);
            A.CallTo(() => returnSchemeDataAccess.GetSelectedSchemesByReturnId(A <Guid> ._)).Returns(returnSchemes);
            A.CallTo(() => genericDataAccess.GetManyByExpression <ReturnReportOn>(A <ReturnReportOnByReturnIdSpecification> ._)).Returns(reportsOn);
            A.CallTo(() => fetchAatfDataAccess.FetchAatfByReturnQuarterWindow(A <Return> ._)).Returns(aatfs);

            await populatedReturn.GetReturnData(A.Dummy <Guid>(), false);

            A.CallTo(() => mapper.Map(A <ReturnQuarterWindow> .That.Matches(c => c.QuarterWindow.Equals(quarterWindow) &&
                                                                            c.Aatfs.Equals(aatfs) &&
                                                                            c.NonObligatedWeeeList.Equals(nonObligatedValues) &&
                                                                            c.ObligatedWeeeReceivedList.Equals(obligatedReceivedValues) &&
                                                                            c.ObligatedWeeeReusedList.Equals(obligatedReusedValues) &&
                                                                            c.ObligatedWeeeSentOnList.Equals(obligatedSentOnValues) &&
                                                                            c.Return.Equals(@return) &&
                                                                            c.ReturnSchemes.Equals(returnSchemes) &&
                                                                            c.ReturnReportOns.Equals(reportsOn)))).MustHaveHappened(Repeated.Exactly.Once);
        }
Exemple #2
0
        public Domain.DataReturns.QuarterWindow GetQuarterWindow()
        {
            var startTime     = new DateTime(2020, 4, 1);
            var endTime       = new DateTime(2020, 7, 16);
            var quarterWindow = new Domain.DataReturns.QuarterWindow(startTime, endTime, QuarterType.Q1);

            return(quarterWindow);
        }