public void DelegatesThroughToFactoryFor_GetObject()
        {
            A.CallTo(() => factory.ContainsObject("bojangles")).Returns(true);
            A.CallTo(() => factory.GetObject("bojangles")).Returns("Rick");

            ObjectReferenceFactoryObject fac = new ObjectReferenceFactoryObject();

            fac.TargetObjectName = "bojangles";
            fac.ObjectFactory    = factory;

            Assert.AreEqual("Rick", fac.GetObject());
        }
        public void DelegatesThroughToFactoryFor_GetObject()
        {
            Expect.Call(factory.ContainsObject("bojangles")).Return(true);
            Expect.Call(factory.GetObject("bojangles")).Return("Rick");
            mocks.ReplayAll();

            ObjectReferenceFactoryObject fac = new ObjectReferenceFactoryObject();
            fac.TargetObjectName = "bojangles";
            fac.ObjectFactory = factory;

            Assert.AreEqual("Rick", fac.GetObject());
            mocks.VerifyAll();
        }
Ejemplo n.º 3
0
        public void DelegatesThroughToFactoryFor_GetObject()
        {
            Expect.Call(factory.ContainsObject("bojangles")).Return(true);
            Expect.Call(factory.GetObject("bojangles")).Return("Rick");
            mocks.ReplayAll();

            ObjectReferenceFactoryObject fac = new ObjectReferenceFactoryObject();

            fac.TargetObjectName = "bojangles";
            fac.ObjectFactory    = factory;

            Assert.AreEqual("Rick", fac.GetObject());
            mocks.VerifyAll();
        }