Example #1
0
            public CreateTestsFixture()
            {
                _mediator = new Mock <IMediator>();
                _mapper   = new Mock <IModelMapper>();

                _autoFixture      = new Fixture();
                _apprenticeshipId = _autoFixture.Create <long>();
                _postRequest      = _autoFixture.Create <CreateChangeOfPartyRequestRequest>();

                _controller = new ChangeOfPartyController(_mediator.Object, _mapper.Object);
            }
            public GetAllTestsFixture()
            {
                _mediator = new Mock <IMediator>();
                _mapper   = new Mock <IModelMapper>();

                _queryResult  = new GetChangeOfPartyRequestsQueryResult();
                _mapperResult = new GetChangeOfPartyRequestsResponse();

                _autoFixture = new Fixture();

                _mediator.Setup(x =>
                                x.Send(It.Is <GetChangeOfPartyRequestsQuery>(q => q.ApprenticeshipId == _apprenticeshipId),
                                       It.IsAny <CancellationToken>()))
                .ReturnsAsync(_queryResult);

                _mapper.Setup(x => x.Map <GetChangeOfPartyRequestsResponse>(_queryResult)).ReturnsAsync(_mapperResult);

                _apprenticeshipId = _autoFixture.Create <long>();

                _controller = new ChangeOfPartyController(_mediator.Object, _mapper.Object);
            }