Ejemplo n.º 1
0
        public void Add_AddingLoggerToCollection_ReturnsCorrectSize()
        {
            const int expectedSize = 1;
            var collection = new LoggerCollection();
            var logger = new ConsoleLogger();

            collection.Add(logger);

            Assert.That(collection.Size(), Is.EqualTo(expectedSize));
        }
Ejemplo n.º 2
0
        public static ILogger Create(Options options)
        {
            ILogger logger;

            if (options.LogError)
            {
                var collection = new LoggerCollection();
                collection.Add(new ConsoleLogger());
                collection.Add(new FileLogger(new FileHelper()));

                logger = collection;
            }
            else
            {
                logger = new ConsoleLogger();
            }

            return logger;
        }