コード例 #1
0
        static public MockLogSettingsManager NewNotSpecified()
        {
            MockLogSettingsManager manager = new MockLogSettingsManager();

            manager.Specified = false;
            return(manager);
        }
コード例 #2
0
        static public MockLogSettingsManager NewSpecified(bool enable)
        {
            MockLogSettingsManager manager = new MockLogSettingsManager();

            manager.Specified = true;
            manager.Enable    = enable;
            return(manager);
        }
コード例 #3
0
        public void Test_LoggingEnabled_DebugMode_InfoLevel_SettingsTrue_ReturnsTrue()
        {
            LogSupervisor supervisor = new LogSupervisor();

            supervisor.ModeDetector    = new MockModeDetector(true);
            supervisor.SettingsManager = MockLogSettingsManager.NewSpecified(true);

            bool isEnabled = supervisor.LoggingEnabled(LogLevel.Info);

            Assert.IsTrue(isEnabled, "Should have been true.");
        }
コード例 #4
0
        public void Test_IsEnabled_MockType_DebugMode_DebugLevel_SettingsNotSpecified_ReturnsFalse()
        {
            LogSupervisor supervisor = new LogSupervisor();

            supervisor.ModeDetector    = new MockModeDetector(true);
            supervisor.SettingsManager = MockLogSettingsManager.NewNotSpecified();

            bool isEnabled = supervisor.IsEnabled("MockType", LogLevel.Debug);

            Assert.IsFalse(isEnabled, "Should have been true.");
        }