public void FleetTest() { IDeliveryVehicle deliveryBike = new DeliveryBike(); IDeliveryVehicle deliveryCar = new DeliveryCar(); IDeliveryVehicle deliveryVan = new DeliveryVan(); IDeliveryVehicle deliveryTruck = new DeliveryTruck(); Fleet fleetOfVehicles = new Fleet(); fleetOfVehicles.Add(deliveryBike); fleetOfVehicles.Add(deliveryCar); fleetOfVehicles.Add(deliveryVan); fleetOfVehicles.Add(deliveryTruck); StringWriter writer = beginReading(); // begin console capture MakeDelivery(fleetOfVehicles); List <String> consoleEntries = endReading(writer); // end console capture var expectedList = new List <string>(new [] { "Bike makes a delivery", "Car makes a delivery", "Van makes a delivery", "Truck makes a delivery" }); Assert.AreEqual(consoleEntries.Count, 4, "Delivery count does not match expected deliveries"); CollectionAssert.AreEqual(consoleEntries, expectedList, "Deliveries don't match expected deliveries"); }
public void BuyFlour() { if (money >= flourPrice) { DeliveryVan van = Instantiate(deliveryVanPrefab, new Vector3(12, 0, 0), Quaternion.identity).GetComponent <DeliveryVan>(); van.stapel = flourSupply; money -= flourPrice; SpendMoney(flourPrice); } }
public void BuyTomatoes() { if (money >= tomatoesPrice) { DeliveryVan van = Instantiate(deliveryVanPrefab, new Vector3(12, 0, 0), Quaternion.identity).GetComponent <DeliveryVan>(); van.stapel = tomatoesSupply; money -= tomatoesPrice; SpendMoney(tomatoesPrice); } }
public void BuyPizzaKarton() { if (money >= pizzakartonPrice) { DeliveryVan van = Instantiate(deliveryVanPrefab, new Vector3(12, 0, 0), Quaternion.identity).GetComponent <DeliveryVan>(); van.stapel = pizzaKartonSupply; money -= pizzakartonPrice; SpendMoney(pizzakartonPrice); } }