Example #1
0
        public async Task QueryAsync_WhenCalled_AssertGetPaymentTermsAsyncWasCalledOnAccountingRepository()
        {
            QueryHandler sut = CreateSut();

            await sut.QueryAsync(new EmptyQuery());

            _accountingRepositoryMock.Verify(m => m.GetPaymentTermsAsync(), Times.Once);
        }
Example #2
0
        public void QueryAsync_WhenQueryIsNull_ThrowsArgumentNullException()
        {
            QueryHandler sut = CreateSut();

            ArgumentNullException result = Assert.ThrowsAsync <ArgumentNullException>(async() => await sut.QueryAsync(null));

            Assert.That(result.ParamName, Is.EqualTo("query"));
        }
Example #3
0
        public async Task QueryAsync_WhenCalled_ReturnsPaymentTermCollectionFromAccountingRepository()
        {
            IEnumerable <IPaymentTerm> paymentTermCollection = _fixture.CreateMany <IPaymentTerm>(_random.Next(5, 10)).ToList();
            QueryHandler sut = CreateSut(paymentTermCollection);

            IEnumerable <IPaymentTerm> result = await sut.QueryAsync(new EmptyQuery());

            Assert.That(result, Is.EqualTo(paymentTermCollection));
        }