public static void ListThem() { List <Car> carList = new List <Car>(); Car carA = new Car(); carA.Color = "blue"; carA.TurnOn(); carA.PressAccelerator(); carList.Add(carA); Car carB = new Car(); carB.Color = "red"; carB.TurnOn(); carB.PressAccelerator(200); carList.Add(carB); Supercar carC = new Supercar(); carC.Color = "green"; carC.TurnOn(); carC.PressAccelerator(200); carList.Add(carC); Console.WriteLine("list size is " + carList.Count); //Trace.WriteLine("list size is " + carList.Count); //Console.ReadLine(); foreach (Car car in carList) { Console.WriteLine(car.ToString()); } }
public void CheckSupercarSpeed() { Supercar superSpeedCheck = new Supercar(); superSpeedCheck.TurnOn(); superSpeedCheck.PressAccelerator(230); Assert.IsTrue(superSpeedCheck.GetReport().Status == Status.Moving); Assert.IsTrue(superSpeedCheck.GetReport().CurrentSpeed == 200); superSpeedCheck.PressAccelerator(); Assert.IsTrue(superSpeedCheck.GetReport().CurrentSpeed == 30); }
public void ListThem() { List <Car> carList = new List <Car>(); Car carA = new Car(); carA.Color = "blue"; carA.TurnOn(); carA.PressAccelerator(); carList.Add(carA); Car carB = new Car(); carB.Color = "red"; carB.TurnOn(); carB.PressAccelerator(200); carList.Add(carB); Supercar carC = new Supercar(); carC.Color = "green"; carC.TurnOn(); carC.PressAccelerator(200); carList.Add(carC); Console.WriteLine("list size is " + carList.Count); Trace.WriteLine("list size is " + carList.Count); }