public void ObjectNamesIncludingAncestorsPreserveOrderOfRegistration() { IList <string> names = ObjectFactoryUtils.ObjectNamesIncludingAncestors(_factory); Assert.AreEqual(5, names.Count); Assert.AreEqual(new string[] { "objA", "objB", "objC", "obj2A", "obj2C" }, names); }
public void ObjectNamesIncludingAncestorsPreserveOrderOfRegistration() { MockRepository mocks = new MockRepository(); IConfigurableListableObjectFactory of = (IConfigurableListableObjectFactory)mocks.DynamicMock(typeof(IConfigurableListableObjectFactory)); IConfigurableListableObjectFactory ofParent = (IConfigurableListableObjectFactory)mocks.DynamicMock(typeof(IConfigurableListableObjectFactory)); Expect.Call(of.GetObjectNamesForType(typeof(object))).Return(new string[] { "objA", "objB", "objC" }); Expect.Call(((IHierarchicalObjectFactory)of).ParentObjectFactory).Return(ofParent); Expect.Call(ofParent.GetObjectNamesForType(typeof(object))).Return(new string[] { "obj2A", "objB", "obj2C" }); mocks.ReplayAll(); string[] names = ObjectFactoryUtils.ObjectNamesIncludingAncestors(of); Assert.AreEqual(5, names.Length); Assert.AreEqual(new string[] { "objA", "objB", "objC", "obj2A", "obj2C" }, names); mocks.VerifyAll(); }
public void ObjectNamesIncludingAncestors() { var names = ObjectFactoryUtils.ObjectNamesIncludingAncestors(_factory); Assert.AreEqual(6, names.Count); }