public void Brake_WhenCalled_DecreaseSpeed() { decimal expectedSpeed = 0; decimal actualSpeed; TestBike.Brake(); actualSpeed = TestBike.GetCurrentSpeed(); Assert.AreEqual(expectedSpeed, actualSpeed); }
private static void Homework1() { //implement code here Console.WriteLine("This is Homework1"); Bicycle myBicycle = new Bicycle(); Bicycle myBicycle2 = new Bicycle("BMX"); Tricycle myTricycle = new Tricycle(); myBicycle.Color = "Green"; myBicycle2.Color = "Red"; myBicycle.Wheeltype = "Offroad"; myBicycle.Wheeltype = "Street"; myTricycle.Color = "Purple"; myTricycle.Wheeltype = "Street"; myBicycle.Pedal(); myBicycle2.Pedal(); myTricycle.Pedal(); myBicycle.HandleBar(); myBicycle2.HandleBar(); myTricycle.HandleBar(); myBicycle.Brake(); myBicycle2.Brake(); myTricycle.Brake(); Console.WriteLine("myBicycle Sprocket Count: " + myBicycle.Sprocket); Console.WriteLine("myBicycle2 Sprocket Count: " + myBicycle2.Sprocket); Console.WriteLine("myTricycle Sprocket Count: " + myTricycle.Sprocket); }
static void Main(string[] args) { Car car = new Car(); Bicycle bicycle = new Bicycle(); car.Ride(); car.Brake(); Console.WriteLine("--------------------"); bicycle.Ride(); bicycle.Wheelie(); bicycle.Brake(); Console.ReadLine(); }