public void OrderArticleWithNoSuppliers() { int price = 10; int idArticle = 2; var organisation = new SupplierOrganisation(); Action testCode = () => { organisation.OrderArticle(idArticle, price + 1); }; Assert.NotNull(Record.Exception(testCode)); }
public void SuccessfulOrderArticle() { int price = 10; int idArticle = 2; var validArticle = new Article(price) { ID = idArticle }; var supplier = new Supplier1("Supplier 1"); supplier.AddArticle(validArticle); var organisation = new SupplierOrganisation(); organisation.AddSupplier(supplier); var orderedArticle = organisation.OrderArticle(idArticle, price + 1); Assert.Equal(orderedArticle, validArticle); }