public async Task QueryAsync_WhenNoAccountWasReturnedFromAccountingRepository_ReturnsNull()
        {
            QueryHandler sut = CreateSut(false);

            IGetAccountQuery query  = CreateQuery();
            IAccount         result = await sut.QueryAsync(query);

            Assert.That(result, Is.Null);
        }
        public async Task QueryAsync_WhenAccountWasReturnedFromAccountingRepository_ReturnsCalculatedAccount()
        {
            IAccount     calculatedAccount = _fixture.BuildAccountMock().Object;
            IAccount     account           = _fixture.BuildAccountMock(calculatedAccount: calculatedAccount).Object;
            QueryHandler sut = CreateSut(account: account);

            IGetAccountQuery query  = CreateQuery();
            IAccount         result = await sut.QueryAsync(query);

            Assert.That(result, Is.EqualTo(calculatedAccount));
        }
        public async Task QueryAsync_WhenCalled_AssertGetAccountAsyncWasCalledOnAccountingRepository()
        {
            QueryHandler sut = CreateSut();

            int              accountingNumber = _fixture.Create <int>();
            string           accountNumber    = _fixture.Create <string>().ToUpper();
            DateTime         statusDate       = _fixture.Create <DateTime>().Date;
            IGetAccountQuery query            = CreateQuery(accountingNumber, accountNumber, statusDate);
            await sut.QueryAsync(query);

            _accountingRepositoryMock.Verify(m => m.GetAccountAsync(
                                                 It.Is <int>(value => value == accountingNumber),
                                                 It.Is <string>(value => string.CompareOrdinal(value, accountNumber) == 0),
                                                 It.Is <DateTime>(value => value == statusDate)),
                                             Times.Once);
        }