コード例 #1
0
        public void Initialize_Context_Wihtout_IParentFinder_Logs_Error()
        {
            LogLevelTarget llt = new LogLevelTarget();

            parentContext.AddLogTarget(llt);
            llt.ERROR += (LogLevelTarget.LogEventDelegate) delegate(object source, object message, object[] messageParams) {
                Assert.Pass();
            };
            parentContext.Install <TestSupportViewStateWatcherExtension> ();
            parentContext.Install <ModularityExtension> ();
            parentContext.Initialize();
            Assert.Fail();
        }
コード例 #2
0
        public void Extension_Logs_Error_When_Context_Initialized_With_No_ContextView()
        {
            bool errorLogged            = false;
            CallbackLogTarget logTarget = new CallbackLogTarget(delegate(LogParams result) {
                if (result.level == LogLevel.ERROR && result.source.GetType() == typeof(ModularityExtension))
                {
                    errorLogged = true;
                }
            });

            childContext.Install(typeof(ModularityExtension)).Install(typeof(SupportParentFinderExtension));
            childContext.AddLogTarget(logTarget);
            childContext.Initialize();
            Assert.That(errorLogged, Is.True);
        }
コード例 #3
0
        public void addChild_logs_warning_unless_child_is_uninitialized()
        {
            LogParams?warning = null;

            context.AddLogTarget(new CallbackLogTarget(
                                     delegate(LogParams log) {
                if (log.level == LogLevel.WARN)
                {
                    warning = log;
                }
            }));
            Context child = new Context();

            child.Initialize();
            context.AddChild(child);
            Assert.That(warning, Is.Not.Null);
            Assert.That(warning.Value.message, Is.StringContaining("must be uninitialized"));
            Assert.That(warning.Value.messageParameters, Is.EqualTo(new object[] { child }).AsCollection);
        }
コード例 #4
0
        public void extension_logs_error_when_context_initialized_with_no_contextView()
        {
            bool errorLogged            = false;
            CallbackLogTarget logTarget = new CallbackLogTarget(delegate(LogParams log) {
                if (log.source is ContextViewExtension && log.level == LogLevel.ERROR)
                {
                    errorLogged = true;
                }
            });

            context.Install <ContextViewExtension>();
            context.AddLogTarget(logTarget);
            context.Initialize();
            Assert.That(errorLogged, Is.True);
        }
コード例 #5
0
 public void Extend(IContext context)
 {
     context.AddLogTarget(new ConsoleLogTarget(context));
 }
コード例 #6
0
        /*============================================================================*/
        /* Public Functions                                                           */
        /*============================================================================*/

        public void Extend(IContext context)
        {
            context.AddLogTarget(this);
            context.injector.MappingOverride += MappingOverrideHandler;
        }
コード例 #7
0
 public void Extend(IContext context)
 {
     context.AddLogTarget(new DebugLogTarget(context));
 }
コード例 #8
0
		public void Extend (IContext context)
		{
			context.AddLogTarget(new DebugLogTarget(context));
		}
コード例 #9
0
		/*============================================================================*/
		/* Public Functions                                                           */
		/*============================================================================*/

		public void Extend (IContext context)
		{
			context.AddLogTarget (this);
			context.injector.MappingOverride += MappingOverrideHandler;
		}
コード例 #10
0
		public void Extend (IContext context)
		{
			context.AddLogTarget(new ConsoleLogTarget(context));
		}