Get the actual instance that is being mocked and controlled. This
enables tracking instance mocks to the actual instance
Namespace: TypeMock
Assembly: TypeMock (in TypeMock.dll) Version: 9.3.6.0 (9.3.6.0)
Syntax
Return Value
Type: ObjectMock Instance
Remarks
Examples
public static void CreateAnObject() { TestClass theClass = new TestClass(); theClass.field = 5; ... } [Test] public void VerifyFutureObject() { //Create new Mock for a future Object, no expectations Mock mock = MockManager.Mock(typeof(TestClass)); // Call our code TheClass.CreateAnObject(); // get the mocked object and test the field TestClass theClass = mock.MockedInstance as TestClass; Assert.AreEqual(5, theClass.field); // Verify that all the expected calls have actually been called. MockManager.Verify(); }
See Also