Beispiel #1
0
 public void LoggerTest()
 {
     Assert.DoesNotThrow(() =>
     {
         var logger = new CarFactoryLogger(LoggingType.File, "log.txt");
         logger.AddFactory(carFactory);
         carFactory.CreateSedan();
         logger.DeleteFactory(carFactory);
         carFactory.CreateEstate();
         logger.EndLog();
     });
 }
Beispiel #2
0
        public Program(ICarFactory factory)
        {
            ICar hatchback = factory.CreateHatchback();
            hatchback.Drive();

            ICar estate = factory.CreateEstate();
            estate.Drive();

            ICar convertible = factory.CreateConvertible();
            convertible.Drive();
            Console.WriteLine("---------------------");
        }
Beispiel #3
0
        public Program(ICarFactory factory)
        {
            ICar hatchback = factory.CreateHatchback();

            hatchback.Drive();

            ICar estate = factory.CreateEstate();

            estate.Drive();

            ICar convertible = factory.CreateConvertible();

            convertible.Drive();
            Console.WriteLine("---------------------");
        }