예제 #1
0
        public void Empty_when_all_components_healthy()
        {
            Container.Register(Component.For <A>(), Component.For <B>(), Component.For <C>());

            var handlers = diagnostic.Inspect();

            Assert.IsEmpty(handlers);
        }
예제 #2
0
        public static IHandler[] GetPotentiallyMisconfigured(IWindsorContainer container)
        {
            IDiagnosticsHost host = (IDiagnosticsHost)container.Kernel.GetSubSystem(SubSystemConstants.DiagnosticsKey);
            IPotentiallyMisconfiguredComponentsDiagnostic diagnostics = host.GetDiagnostic <IPotentiallyMisconfiguredComponentsDiagnostic>();

            return(diagnostics.Inspect());
        }
        public override IEnumerable <DebuggerViewItem> Attach()
        {
            var handlers = diagnostic.Inspect();

            if (handlers.Length == 0)
            {
                return(Enumerable.Empty <DebuggerViewItem>());
            }

            var items = Array.ConvertAll(handlers, DefaultComponentView);

            return(new[]
            {
                new DebuggerViewItem(name, "Count = " + items.Length, items)
            });
        }
예제 #4
0
        public override IEnumerable <DebuggerViewItem> Attach()
        {
            var handlers = diagnostic.Inspect();

            if (handlers.Length == 0)
            {
                return(Enumerable.Empty <DebuggerViewItem>());
            }

            Array.Sort(handlers, (f, s) => f.ComponentModel.Name.CompareTo(s.ComponentModel.Name));
            var items = handlers.ConvertAll(DefaultComponentView);

            return(new[]
            {
                new DebuggerViewItem(name, "Count = " + items.Length, items)
            });
        }