public void ChangeBackOnDispose() { IMethodRecorder recorder = new UnorderedMethodRecorder(new ProxyMethodExpectationsDictionary()); MethodRecorderBaseTests.TestMethodRecorder testRecorder = new MethodRecorderBaseTests.TestMethodRecorder(); using (new RecorderChanger(mocks, recorder, testRecorder)) { Assert.Same(testRecorder, Get.Recorder(mocks)); } Assert.NotSame(testRecorder, Get.Recorder(mocks)); testRecorder.DoRecordCalled = false; recorder.Record(proxy, method, expectation); Assert.False(testRecorder.DoRecordCalled); }
public void ChangeRecorderOnCtor() { IMethodRecorder recorder = new UnorderedMethodRecorder(new ProxyMethodExpectationsDictionary()); MethodRecorderBaseTests.TestMethodRecorder testRecorder = new MethodRecorderBaseTests.TestMethodRecorder(); new RecorderChanger(mocks, recorder, testRecorder); recorder.GetAllExpectationsForProxy(new object()); Assert.True(testRecorder.DoGetAllExpectationsForProxyCalled); Assert.Same(testRecorder, Get.Recorder(mocks)); }