public void SetUp() { theEnvelope = new Envelope() { Data = new byte[] { 1, 2, 3, 4 }, }; theSerializer = MockRepository.GenerateMock <IEnvelopeSerializer>(); theEnvelope.Headers["A"] = "1"; theEnvelope.Headers["B"] = "2"; theEnvelope.Headers["C"] = "3"; theEnvelope.CorrelationId = Guid.NewGuid().ToString(); theChannel = new RecordingChannel(); theNode = new ChannelNode { Channel = theChannel, Key = "Foo", Uri = "foo://bar".ToUri() }; theNode.Modifiers.Add(new HeaderSetter("D", "4")); theNode.Modifiers.Add(new HeaderSetter("E", "5")); theNode.Send(theEnvelope, theSerializer); }
public void SetUp() { theEnvelope = new Envelope() { Data = new byte[]{1,2,3,4}, }; theEnvelope.Headers["A"] = "1"; theEnvelope.Headers["B"] = "2"; theEnvelope.Headers["C"] = "3"; theChannel = new RecordingChannel(); theNode = new ChannelNode { Channel = theChannel, Key = "Foo", Uri = "foo://bar".ToUri() }; theNode.Send(theEnvelope); }
public void SetUp() { theEnvelope = new Envelope() { Data = new byte[]{1,2,3,4}, }; theSerializer = MockRepository.GenerateMock<IEnvelopeSerializer>(); theEnvelope.Headers["A"] = "1"; theEnvelope.Headers["B"] = "2"; theEnvelope.Headers["C"] = "3"; theEnvelope.CorrelationId = Guid.NewGuid().ToString(); theChannel = new RecordingChannel(); theNode = new ChannelNode { Channel = theChannel, Key = "Foo", Uri = "foo://bar".ToUri() }; theNode.Modifiers.Add(new HeaderSetter("D", "4")); theNode.Modifiers.Add(new HeaderSetter("E", "5")); theNode.Send(theEnvelope, theSerializer); }
public static string ToSerialString(this RecordingChannel value) => value switch {
public void StartRecordingLatestVersion_Returns404NotFound(Uri sampleCallBackUri, RecordingContent?recordingContentType, RecordingChannel recordingChannelType, RecordingFormat recordingFormatType) { ServerCall serverCall = CreateMockServerCall(404); RequestFailedException?ex = Assert.Throws <RequestFailedException>(() => serverCall.StartRecording(sampleCallBackUri, recordingContentType, recordingChannelType, recordingFormatType)); Assert.NotNull(ex); Assert.AreEqual(ex?.Status, 404); }
public void StartRecordingLatestVersion_Returns200Ok(Uri sampleCallBackUri, RecordingContent?recordingContentType, RecordingChannel recordingChannelType, RecordingFormat recordingFormatType) { ServerCall serverCall = CreateMockServerCall(200, responseContent: DummyStartRecordingResponse); StartRecordingResult result = serverCall.StartRecording(sampleCallBackUri, recordingContentType, recordingChannelType, recordingFormatType); Assert.AreEqual("dummyRecordingId", result.RecordingId); }