Ejemplo n.º 1
0
        public async Task Then_Maps_GetApprenticeshipsQueryResultToGetApprenticeshipsResponse(
            GetApprenticeshipsQueryResult source,
            GetApprenticeshipsResponseMapper mapper)
        {
            var result = await mapper.Map(source);

            result.Apprenticeships.First().Should().BeEquivalentTo(source.Apprenticeships.First());
            result.TotalApprenticeshipsFound.Should().Be(source.TotalApprenticeshipsFound);
            result.TotalApprenticeshipsWithAlertsFound.Should().Be(source.TotalApprenticeshipsWithAlertsFound);
            result.TotalApprenticeships.Should().Be(source.TotalApprenticeships);
            result.PageNumber.Should().Be(source.PageNumber);
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            _accountId     = _fixture.Create <int>();
            _status        = _fixture.Create <string>();
            _pageNumber    = _fixture.Create <int>();
            _pageItemCount = _fixture.Create <int>();

            _mediator = new Mock <IMediator>();

            _queryResult = _fixture.Create <GetApprenticeshipsQueryResult>();
            _mediator.Setup(x => x.Send(It.IsAny <GetApprenticeshipsQuery>(), CancellationToken.None))
            .ReturnsAsync(_queryResult);

            _controller = new ApprovalsController(_mediator.Object, Mock.Of <ILogger <ApprovalsController> >());
        }