Beispiel #1
0
 public void ReadMessage_should_throw_if_textReader_was_not_provided()
 {
     using (var textWriter = new StringWriter())
     {
         var    subject = new KillCursorsMessageJsonEncoder(null, textWriter, __messageEncoderSettings);
         Action action  = () => subject.ReadMessage();
         action.ShouldThrow <InvalidOperationException>();
     }
 }
Beispiel #2
0
 public void ReadMessage_should_read_a_message()
 {
     using (var textReader = new StringReader(__testMessageJson))
     {
         var subject = new KillCursorsMessageJsonEncoder(textReader, null, __messageEncoderSettings);
         var message = subject.ReadMessage();
         message.CursorIds.Should().Equal(__cursorIds);
         message.RequestId.Should().Be(__testMessage.RequestId);
     }
 }
Beispiel #3
0
 public void ReadMessage_should_throw_if_jsonReader_was_not_provided()
 {
     using (var stringWriter = new StringWriter())
         using (var jsonWriter = new JsonWriter(stringWriter))
         {
             var    subject = new KillCursorsMessageJsonEncoder(null, jsonWriter);
             Action action  = () => subject.ReadMessage();
             action.ShouldThrow <InvalidOperationException>();
         }
 }
 public void ReadMessage_should_read_a_message()
 {
     using (var textReader = new StringReader(__testMessageJson))
     {
         var subject = new KillCursorsMessageJsonEncoder(textReader, null, __messageEncoderSettings);
         var message = subject.ReadMessage();
         message.CursorIds.Should().Equal(__cursorIds);
         message.RequestId.Should().Be(__testMessage.RequestId);
     }
 }
 public void ReadMessage_should_throw_if_textReader_was_not_provided()
 {
     using (var textWriter = new StringWriter())
     {
         var subject = new KillCursorsMessageJsonEncoder(null, textWriter, __messageEncoderSettings);
         Action action = () => subject.ReadMessage();
         action.ShouldThrow<InvalidOperationException>();
     }
 }
 public void ReadMessage_should_throw_if_jsonReader_was_not_provided()
 {
     using (var stringWriter = new StringWriter())
     using (var jsonWriter = new JsonWriter(stringWriter))
     {
         var subject = new KillCursorsMessageJsonEncoder(null, jsonWriter);
         Action action = () => subject.ReadMessage();
         action.ShouldThrow<InvalidOperationException>();
     }
 }