Exemplo n.º 1
0
        public async Task ThenShouldReturnGetTransferConnectionInvitationsResponse()
        {
            _response = await _handler.Handle(_query);

            Assert.That(_response, Is.Not.Null);
            Assert.That(_response.TransferConnectionInvitations.Count(), Is.EqualTo(2));
            Assert.That(_response.TransferConnectionInvitations.ElementAt(0), Is.Not.Null);
            Assert.That(_response.TransferConnectionInvitations.ElementAt(0).Id, Is.EqualTo(_receivedTransferConnectionInvitation.Id));
            Assert.That(_response.TransferConnectionInvitations.ElementAt(1), Is.Not.Null);
            Assert.That(_response.TransferConnectionInvitations.ElementAt(1).Id, Is.EqualTo(_sentTransferConnectionInvitation.Id));
        }
        public void Arrange()
        {
            _query = new GetTransferConnectionInvitationsQuery();

            _response = new GetTransferConnectionInvitationsResponse
            {
                TransferConnectionInvitations = new List <TransferConnectionInvitationDto>()
            };

            _mapperConfig = new MapperConfiguration(c => c.AddProfile <TransferMappings>());
            _mapper       = _mapperConfig.CreateMapper();
            _mediator     = new Mock <IMediator>();
            _mediator.Setup(m => m.SendAsync(_query)).ReturnsAsync(_response);

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