コード例 #1
0
        public void ChangingDefaultMockObjectFactoryChangesBehaviourOfNewMockeryInstances()
        {
            var mocksA = new Mockery();
            mocksA.SetMockFactoryAs(new TestingMockObjectFactoryA());
            Assert.AreEqual("TestingMockObjectFactoryA", mocksA.NewInstanceOfRole<INamed>().GetName());

            mocksA.SetMockFactoryAs(new TestingMockObjectFactoryB());
            Assert.AreEqual("TestingMockObjectFactoryB", mocksA.NewInstanceOfRole<INamed>().GetName());
        }