コード例 #1
0
 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));
 }
コード例 #2
0
        public void CountObjectsIncludingAncestorsWithNonHierarchicalFactory()
        {
            StaticListableObjectFactory lof = new StaticListableObjectFactory();

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