Exemplo n.º 1
0
        public async Task ThenIfNoTransactionsAreFoundANotFoundStatusIsReturned()
        {
            //Arrange
            _mediator.Setup(x => x.SendAsync(It.IsAny <FindAccountProviderPaymentsQuery>()))
            .ThrowsAsync(new NotFoundException(string.Empty));

            //Act
            var result = await _orchestrator.FindAccountPaymentTransactions(HashedAccountId, ExpectedUkPrn, _fromDate, _toDate,
                                                                            ExternalUser);

            //Assert
            Assert.AreEqual(HttpStatusCode.NotFound, result.Status);
        }
Exemplo n.º 2
0
        public async Task ThenARequestShouldBeMadeForPaymentDetails()
        {
            //Arrange
            const long ukprn = 10;

            //Act
            await _orchestrator.FindAccountPaymentTransactions(HashedAccountId, ukprn, _fromDate, _toDate,
                                                               ExternalUser);

            //Assert
            _mediator.Verify(x => x.SendAsync(It.Is <FindAccountProviderPaymentsQuery>(
                                                  q => q.HashedAccountId.Equals(HashedAccountId) &&
                                                  q.FromDate.Equals(_fromDate) &&
                                                  q.ToDate.Equals(_toDate) &&
                                                  q.ExternalUserId.Equals(ExternalUser))));
        }