public void CountObjectsIncludingAncestors()
 {
     // leaf count...
     Assert.AreEqual(1, _factory.ObjectDefinitionCount);
     // count minus duplicate...
     Assert.AreEqual(6, ObjectFactoryUtils.CountObjectsIncludingAncestors(_factory),
                     "Should count 6 objects, not " + ObjectFactoryUtils.CountObjectsIncludingAncestors(_factory));
 }
        public void CountObjectsIncludingAncestorsWithNonHierarchicalFactory()
        {
            StaticListableObjectFactory lof = new StaticListableObjectFactory();

            lof.AddObject("t1", new TestObject());
            lof.AddObject("t2", new TestObject());
            Assert.IsTrue(ObjectFactoryUtils.CountObjectsIncludingAncestors(lof) == 2);
        }