public async Task AndInvalidPeriodIsPassedThenItShouldReturnError()
        {
            // Arrange
            var periodQueryResponse = new GetPeriodQueryResponse
            {
                IsValid   = false,
                Exception = new ValidationException(new[] { "mars attacks!" })
            };

            _mockMediator.Setup(m => m.SendAsync(It.IsAny <GetPeriodQueryRequest>())).ReturnsAsync(periodQueryResponse).Verifiable("GetPeriod was never called");

            // Act
            var actual = await _controller.GetTransfers("regular");

            // Assert
            _mockMediator.VerifyAll();
            Assert.IsInstanceOf <BadRequestErrorMessageResult>(actual);
        }
        public async Task ThenItShouldReturnTransfers()
        {
            // Arrange

            var periodQueryResponse = new GetPeriodQueryResponse
            {
                IsValid = true,
                Result  = new Period()
            };

            var transfer = new AccountTransfer
            {
                TransferId        = 1,
                SenderAccountId   = 1,
                ReceiverAccountId = 2,
                Amount            = 3,
                RequiredPaymentId = Guid.Empty,
                Type = TransferType.Levy
            };

            _mockMediator.Setup(m => m.SendAsync(It.IsAny <GetPeriodQueryRequest>())).ReturnsAsync(periodQueryResponse).Verifiable("GetPeriod was never called");
            _mockMediator.Setup(m => m.SendAsync(It.IsAny <GetTransfersQueryRequest>())).ReturnsAsync(new GetTransfersQueryResponse
            {
                IsValid = true,
                Result  = new PageOfResults <AccountTransfer> {
                    Items = new[] { transfer }
                }
            }).Verifiable("GetTransfersQuery was never called");

            // Act
            var actual = await _controller.GetTransfers("regular");

            // Assert
            _mockMediator.VerifyAll();
            Assert.IsNotNull(actual);
            Assert.IsInstanceOf <OkNegotiatedContentResult <PageOfResults <AccountTransfer> > >(actual);
            Assert.AreSame(transfer, ((OkNegotiatedContentResult <PageOfResults <AccountTransfer> >)actual).Content.Items[0]);
        }