Beispiel #1
0
        public void ThrowsInvalidInvoiceNumberExceptionWhenNoInvoiceNumber()
        {
            var invoice = _invoiceBuilder.WithInvoiceNumber(0).Build();

            // Fluent Assertions
            Func <Task> act = async() =>
            {
                await _repository.StoreInvoice(invoice);
            };

            act.ShouldThrow <InvalidInvoiceNumberException>("because there is NO invoice number!");

            // NUnit
            Assert.ThrowsAsync <InvalidInvoiceNumberException>(() => _repository.StoreInvoice(invoice));
        }
Beispiel #2
0
        public async Task ThrowsInvalidInvoiceNumberExceptionWhenNoInvoiceNumber()
        {
            var invoice = _invoiceBuilder.WithInvoiceNumber(0).Build();

            await Assert.ThrowsExceptionAsync <InvalidInvoiceNumberException>(() => _repository.StoreInvoice(invoice));
        }
 public Task ThrowsInvalidInvoiceNumberExceptionWhenNoInvoiceNumber() =>
 Assert.ThrowsAsync <InvalidInvoiceNumberException>(
     () => _repository.StoreInvoice(_invoiceBuilder.WithInvoiceNumber(0).Build()));