public void testGetTotalCompletionTime() { //arrange FacadeManagement facade = FacadeManagement.getInstance(); Bike bike1 = new Bike(); bike1.Frame.FrameColour = "Blue"; bike1.Frame.FrameSize = "Small"; bike1.GroupSet.Gears = "Thumb Shifter"; bike1.GroupSet.Brakes = "Disk Brakes"; bike1.Wheels.WheelsType = "Mountain"; bike1.FinishingSet.HandleBars = "Riser Bars"; bike1.FinishingSet.Saddle = "Forward"; //act facade.addBike(bike1); //assert (With just one bike in the list all the stock is available and the time should be 32H and there are three at the moment) Assert.AreEqual(32 * 3, facade.getTotalCompletionTime(), "Facade get total completion time method not implemented correctly"); }
public void testUpdateStockBackMethod() { //arrange FacadeManagement facade = FacadeManagement.getInstance(); Stock stock = Stock.getInstance(); int initialAmount = stock.getFrameStock()["Small"]; Bike bike1 = new Bike(); bike1.Frame.FrameColour = "Blue"; bike1.Frame.FrameSize = "Small"; bike1.GroupSet.Gears = "Thumb Shifter"; bike1.GroupSet.Brakes = "Disk Brakes"; bike1.Wheels.WheelsType = "Mountain"; bike1.FinishingSet.HandleBars = "Riser Bars"; bike1.FinishingSet.Saddle = "Forward"; //act facade.addBike(bike1); facade.getTotalCompletionTime(); facade.updateStockBack(); //assert Assert.AreEqual(initialAmount, stock.getFrameStock()["Small"], "Facade updated back method not implemented correctly"); }
//Display completion time private void displayCompletionTime() { completionTimeLbl.Content = facade.getTotalCompletionTime() + " Hours"; }