Beispiel #1
0
        static void Main(string[] args)
        {
            Seat seat = new Seat();

            System.Console.WriteLine(seat.Start());//From base class
            System.Console.WriteLine(seat.Stop());

            ICar tesla = new Tesla("3", "Black");

            System.Console.WriteLine(tesla.Start());
            System.Console.WriteLine(tesla.ToString());
            System.Console.WriteLine(tesla.Stop());
            System.Console.WriteLine(tesla.ToString());
        }
Beispiel #2
0
        public static void Main()
        {
            ICar seat  = new Seat("Leon", "Grey");
            ICar tesla = new Tesla("Model 3", "Red", 2);

            Console.WriteLine(seat.ToString());
            Console.WriteLine(tesla.ToString());
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            ICar seat  = new Seat("Ibiza", "Grey");
            ICar tesla = new Tesla("Model 3", "Black", 99);

            Console.WriteLine(seat.ToString());
            Console.WriteLine(tesla.ToString());
        }
Beispiel #4
0
        static void Main()
        {
            ICar seat = new Seat("Leon", "Grey");
            ICar tesla = new Tesla("Model S", "White", 4);

            Console.WriteLine(seat.ToString());
            Console.WriteLine(tesla.ToString());
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            var seat  = new Seat("Leon", "Grey");
            var tesla = new Tesla("Model 3", "Red", 2);

            Console.WriteLine(seat);
            Console.WriteLine(tesla.ToString());
        }
Beispiel #6
0
        static void Main(string[] args)
        {
            ICar seat  = new Seat("Ibisa", "red");
            ICar tesla = new Tesla("Model S", "white", 2);

            Console.WriteLine(seat.ToString());
            Console.WriteLine(tesla.ToString());

            Console.WriteLine(tesla.);
        }
Beispiel #7
0
        static void Main(string[] args)
        {
            ICar seat  = new Seat("Leon", "Grey");
            ICar tesla = new Tesla("Model 3", "Red", 2);

            Console.WriteLine(seat.ToString());
            seat.Start();
            seat.Stop();
            Console.WriteLine(tesla.ToString());
            tesla.Start();
            tesla.Stop();
        }
Beispiel #8
0
        public static void Main(string[] args)
        {
            try
            {
                ICar seat  = new Seat("Leon", "Grey");
                ICar tesla = new Tesla("Model 3", "Red", 2);

                Console.WriteLine(seat.ToString());
                Console.WriteLine(tesla.ToString());
            }
            catch (ArgumentException exception)
            {
                Console.WriteLine(exception.Message);
            }
        }