public void ServiceTypeFulfillmentService_Tests() { // Arrange var serviceTypeFulfillmentService = new ServiceTypeFulfillmentService(); // Act var result = serviceTypeFulfillmentService.GetPurchaseOrderItems(new TestData().Create()); // Assert Assert.NotEmpty(result); Assert.All(result, item => Assert.True(item.SelfFulfillment)); }
static void Main(string[] args) { // Our data store var purchaseRequirements = new TestData().Create(); // Dependencies at top of composition root var supplierService = new SupplierService(); var supplierShippingCostCalculator = new SupplierShippingCostCalculator(); var stockCalculatorService = new StockCalculatorService(); var purchaseOrderFulfillmentService = new PurchaseOrderFulfillmentService(stockCalculatorService); var productFulfillmentService = new ProductFulfillmentService(supplierService, supplierShippingCostCalculator, purchaseOrderFulfillmentService); var serviceTypeFulfillmentService = new ServiceTypeFulfillmentService(); // Optimize and generate purchase orders for suppliers to fulfill var purchaseOptimizer = new PurchaseOptimizer(new List <IFulfillmentService>() { serviceTypeFulfillmentService, productFulfillmentService }); purchaseOptimizer.Optimize(purchaseRequirements); Console.Read(); }