Esempio n. 1
0
        public void Test_MyFacility_Init()
        {
            IKernel kernel = new DefaultKernel();

            kernel.ConfigurationStore = new DefaultConfigurationStore();
            var configFile = GetConfigFile(LoggerImplementation.ExtendedLog4net);
            Action <LoggingFacility> onCreate = f => f.LogUsing(LoggerImplementation.ExtendedLog4net).WithConfig(configFile);
            var facility = new MyLoggingFacility(kernel, null);

            onCreate.Invoke(facility);
            facility.MyInit();
            Assert.IsNotNull(facility);
        }
Esempio n. 2
0
        public void Test_MyFacility_SetupConverter()
        {
            IKernel kernel = new DefaultKernel();

            kernel.ConfigurationStore = new DefaultConfigurationStore();
            var configFile = GetConfigFile(LoggerImplementation.ExtendedLog4net);
            Action <LoggingFacility> onCreate = f => f.LogUsing(LoggerImplementation.ExtendedLog4net).WithConfig(configFile);
            var facility = new MyLoggingFacility(kernel, null);

            onCreate.Invoke(facility);
            var converter =
                facility.MyKernel.GetSubSystem(SubSystemConstants.ConversionManagerKey) as IConversionManager;

            Assert.IsNotNull(converter);
        }
Esempio n. 3
0
        public void Test_MyFacility_ReadLoggingApi()
        {
            IKernel kernel = new DefaultKernel();

            kernel.ConfigurationStore = new DefaultConfigurationStore();
            var configFile = GetConfigFile(LoggerImplementation.ExtendedLog4net);
            Action <LoggingFacility> onCreate = f => f.LogUsing(LoggerImplementation.ExtendedLog4net).WithConfig(configFile);
            var facility = new MyLoggingFacility(kernel, null);

            onCreate.Invoke(facility);
            facility.SetupConverter();
            var api = facility.ReadApi();

            Assert.IsNotNull(api);
            Assert.AreEqual(api, LoggerImplementation.ExtendedLog4net);
        }