コード例 #1
0
 protected override ISampleEndpoint GetSampleEndpointForRecording()
 {
     ISampleEndpoint advicedSampleEndpoint = new SampleEndpoint();
     ICallCommandRepository callCommandRepository = CreateCallFileRepository();
     ICallRecorder callRecorder = new CallRecorder(callCommandRepository) { Enabled = true };
     return new SampleEndpointRecordingAdvice(advicedSampleEndpoint, callRecorder);
 }
コード例 #2
0
 protected virtual ISampleEndpoint GetSampleEndpointForStubbing()
 {
     var advicedSampleEndpoint = new SampleEndpoint();
     var callQueryRepository = CreateCallFileRepository();
     var callStubber = new CallStubber(callQueryRepository) { Enabled = RecordingAndStubbingEnabled };
     return new SampleEndpointStubbingAdvice(advicedSampleEndpoint, callStubber);
 }
コード例 #3
0
 protected override ISampleEndpoint GetSampleEndpointForRecording()
 {
     var advicedSampleEndpoint = new SampleEndpoint();
     var callCommandRepository = CreateCallFileRepository();
     var callRecorder = new CallRecorder(callCommandRepository) { Enabled = RecordingAndStubbingEnabled };
     return new SampleEndpointRecordingAdvice(advicedSampleEndpoint, callRecorder);
 }
コード例 #4
0
        public void ShouldThrowExceptionWhenThrowExceptionIsTrue()
        {
            var sampleEndpoint = new SampleEndpoint { ThrowException = true };

            Assert.That(() => sampleEndpoint.SampleMethod(null), Throws.Exception);
        }
コード例 #5
0
        public void ShouldNotThrowExceptionWhenThrowExceptionIsFalse()
        {
            var sampleEndpoint = new SampleEndpoint {ThrowException = false };

            Assert.That(() => sampleEndpoint.SampleMethod(null), Throws.Nothing);
        }