public FinishedWindow(Bike bike)
 {
     InitializeComponent();
     newBike = bike;
     facade.addBike(newBike);
     displayBikeCost();
 }
Ejemplo n.º 2
0
        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");
        }
Ejemplo n.º 3
0
        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");
        }
Ejemplo n.º 4
0
        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");
        }