Ejemplo n.º 1
0
        public async Task And_Application_Exists_Response_Returned(
            GetDeclinedQuery getDeclinedQuery,
            GetApplicationResponse getApplicationResponse,
            Models.Pledge pledgeResponse,
            [Frozen] Mock <ILevyTransferMatchingService> mockLevyTransferMatchingService,
            GetDeclinedQueryHandler getDeclinedQueryHandler)
        {
            mockLevyTransferMatchingService
            .Setup(x => x.GetApplication(It.Is <GetApplicationRequest>(y => y.GetUrl.Contains(getDeclinedQuery.ApplicationId.ToString()))))
            .ReturnsAsync(getApplicationResponse);

            mockLevyTransferMatchingService
            .Setup(x => x.GetPledge(It.Is <int>(y => y == getApplicationResponse.PledgeId)))
            .ReturnsAsync(pledgeResponse);

            var result = await getDeclinedQueryHandler.Handle(getDeclinedQuery, CancellationToken.None);

            Assert.IsNotNull(result);
            Assert.AreEqual(pledgeResponse.DasAccountName, result.EmployerAccountName);
        }