public async Task And_Application_Doesnt_Exist_Returns_Null( GetWithdrawnQuery getWithdrawnQuery, [Frozen] Mock <ILevyTransferMatchingService> mockLevyTransferMatchingService, GetWithdrawnQueryHandler getWithdrawnQueryHandler) { mockLevyTransferMatchingService .Setup(x => x.GetApplication(It.Is <GetApplicationRequest>(y => y.GetUrl.Contains(getWithdrawnQuery.ApplicationId.ToString())))) .ReturnsAsync((GetApplicationResponse)null); var result = await getWithdrawnQueryHandler.Handle(getWithdrawnQuery, CancellationToken.None); Assert.IsNull(result); }
public async Task And_Application_Exists_Response_Returned( GetWithdrawnQuery getWithdrawnQuery, GetApplicationResponse getApplicationResponse, [Frozen] Mock <ILevyTransferMatchingService> mockLevyTransferMatchingService, GetWithdrawnQueryHandler getWithdrawnQueryHandler) { mockLevyTransferMatchingService .Setup(x => x.GetApplication(It.Is <GetApplicationRequest>(y => y.GetUrl.Contains(getWithdrawnQuery.ApplicationId.ToString())))) .ReturnsAsync(getApplicationResponse); var result = await getWithdrawnQueryHandler.Handle(getWithdrawnQuery, CancellationToken.None); Assert.IsNotNull(result); Assert.AreEqual(getApplicationResponse.EmployerAccountName, result.EmployerAccountName); }