Beispiel #1
0
        public void testGetBikeCost()
        {
            //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 (Values are taken from the stock class)
            int bikeCost = facade.getBikeCost(bike1);
            int cost     = 100 + 30 + 40 + 100 + 150 + 20 + 50;

            //assert
            Assert.AreEqual(cost, bikeCost, "Facade get bike cost method not implemented correctly");
        }
 //Display the bike cost
 private void displayBikeCost()
 {
     bikeCostLbl.Content = facade.getBikeCost(newBike).ToString();
 }