Beispiel #1
0
        public virtual void PrototypeReferences()
        {
            // check that not broken by circular reference resolution mechanism
            DummyReferencer ref1 = (DummyReferencer)ObjectFactory.GetObject("prototypeReferencer");

            Assert.IsTrue(ref1.TestObject1 != ref1.TestObject2, "Not referencing same Object twice");
            DummyReferencer ref2 = (DummyReferencer)ObjectFactory.GetObject("prototypeReferencer");

            Assert.IsTrue(ref1 != ref2, "Not the same referencer");
            Assert.IsTrue(ref2.TestObject1 != ref2.TestObject2, "Not referencing same Object twice");
            Assert.IsTrue(ref1.TestObject1 != ref2.TestObject1, "Not referencing same Object twice");
            Assert.IsTrue(ref1.TestObject2 != ref2.TestObject2, "Not referencing same Object twice");
            Assert.IsTrue(ref1.TestObject1 != ref2.TestObject2, "Not referencing same Object twice");
        }
Beispiel #2
0
        public virtual void FactoryReferences()
        {
            DummyReferencer dref = (DummyReferencer)ObjectFactory.GetObject("factoryReferencer");

            Assert.IsTrue(dref.TestObject1 == dref.TestObject2);
        }