public void Can_detect_singleton_depending_on_transient()
        {
            Container.Register(Component.For <B>().LifeStyle.Singleton,
                               Component.For <A>().LifeStyle.Transient);

            var mismatches = diagnostic.Inspect();

            Assert.AreEqual(1, mismatches.Length);
        }
Пример #2
0
        public override IEnumerable <DebuggerViewItem> Attach()
        {
            var mismatches = diagnostic.Inspect();

            if (mismatches.Length == 0)
            {
                yield break;
            }

            var items = Array.ConvertAll(mismatches, MismatchedComponentView);

            yield return(new DebuggerViewItem(name, "Count = " + mismatches.Length, items));
        }
        public override IEnumerable <DebuggerViewItem> Attach()
        {
            var mismatches = diagnostic.Inspect();

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

            Array.Sort(mismatches, (f, s) => f[0].ComponentModel.Name.CompareTo(s[0].ComponentModel.Name));
            var items = Array.ConvertAll(mismatches, MismatchedComponentView);

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