示例#1
0
        public void Discover()
        {
            DiscoverableParent parent = new DiscoverableParent();

            IList <IDiscoverableChild> list = Discoverer.Discover <IDiscoverableChild>(parent);

            Assert.Equal(3, list.Count);
        }
示例#2
0
        public void DiscoverSelfReferential()
        {
            DiscoverableParent parent = new DiscoverableParent();

            parent.Parent = new DiscoverableParent();

            IList <IDiscoverableParent> list = Discoverer.Discover <IDiscoverableParent>(parent);

            Assert.Equal(2, list.Count);

            parent.Parent = parent;

            list = Discoverer.Discover <IDiscoverableParent>(parent);

            Assert.Equal(1, list.Count);
        }