Exemple #1
0
        public async Task ThenItShouldReturnAOkResult()
        {
            //Arrange
            _periodId = "1920-R12";
            _mediator.Setup(m => m.SendAsync(It.Is <GetPaymentsQueryRequest>(r =>
                                                                             r.Period.AcademicYear == 1920 &&
                                                                             r.Period.Period == 12 &&
                                                                             r.EmployerAccountId == EmployerAccountId &&
                                                                             r.PageNumber == Page &&
                                                                             r.PageSize == PageSize &&
                                                                             r.Ukprn == Ukprn)))
            .ReturnsAsync(new GetPaymentsQueryResponse
            {
                IsValid = true,
                Result  = new PageOfResults <Payment>
                {
                    PageNumber         = Page,
                    TotalNumberOfPages = TotalNumberOfPages,
                    Items = new[] { _payment1 }
                }
            });

            // Act
            var actual = await _controller
                         .GetListOfPayments(_periodId, EmployerAccountId, Page, Ukprn)
                         .ConfigureAwait(false);

            // Assert
            Assert.IsNotNull(actual);
            Assert.IsInstanceOf <OkNegotiatedContentResult <PageOfResults <Payment> > >(actual);
        }
Exemple #2
0
        public async Task ThenItShouldReturnAOkResult()
        {
            // Act
            var actual = await _controller
                         .GetListOfPayments(PeriodId, EmployerAccountId, Page, Ukprn)
                         .ConfigureAwait(false);

            // Assert
            Assert.IsNotNull(actual);
            Assert.IsInstanceOf <OkNegotiatedContentResult <PageOfResults <Payment> > >(actual);
        }