public void testClearBikeListMethod() { //arrange FacadeManagement facade = FacadeManagement.getInstance(); //act facade.clearBikeList(); //assert (If the bike list is empty the bike cost is 0) Assert.AreEqual(0, facade.getTotalBikesCost(), "Facade clear bike method do not implemented correctly"); }
public void testGetTotalBikesCost() { //arrange FacadeManagement facade = FacadeManagement.getInstance(); //act (Values are taken from the stock class, the three bikes added have the same components) int totalCost = 100 * 3 + 30 * 3 + 3 * 40 + 100 * 3 + 150 * 3 + 20 * 3 + 50 * 3; //assert (There are already three bikes added so the test is performed with those three bikes) Assert.AreEqual(totalCost, facade.getTotalBikesCost(), "Facade get total bikes cost method not implemented correctly"); }
public void testAddBikeMethod() { //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 (if the list is empty then the bike cost would be 0) Assert.AreNotEqual(0, facade.getTotalBikesCost(), "Bike not added correctly"); }
//Display total order cost private void displayTotalCost() { totalCostLbl.Content = facade.getTotalBikesCost().ToString(); }