コード例 #1
0
 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);
 }
コード例 #2
0
 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));
 }