public async Task CantProcessNullOrder() { PurchaseOrderProcessingService service = new PurchaseOrderProcessingService(); var exception = await Record.ExceptionAsync(async() => { await service.ProcessPurchaseOrderAsync(null); }); Assert.NotNull(exception); Assert.IsType <ArgumentNullException>(exception); }
public async Task CantProcessInvalidOrder() { PurchaseOrderProcessingService service = new PurchaseOrderProcessingService(); var ex = await Record.ExceptionAsync(async() => { PurchaseOrder order = new PurchaseOrder(); await service.ProcessPurchaseOrderAsync(order); }); Assert.NotNull(ex); Assert.IsType <ValidationErrorException>(ex); }
public void ProcessorsListIsNotEmpty() { PurchaseOrderProcessingService service = new PurchaseOrderProcessingService(); Assert.NotEmpty(service.Processors); }