コード例 #1
0
        public void MultipleMessages()
        {
            var context = new FudgeContext();

            var msg1 = StandardFudgeMessages.CreateMessageWithSubMsgs(context);
            var msg2 = StandardFudgeMessages.CreateMessageAllNames(context);
            var reader = new FudgeMsgStreamReader(context, new FudgeMsg[] {msg1, msg2});
            var writer = new FudgeMsgStreamWriter();

            var pipe = new FudgeStreamPipe(reader, writer);
            pipe.Process();

            Assert.Equal(2, writer.PeekAllMessages().Count);
            FudgeUtils.AssertAllFieldsMatch(msg1, writer.DequeueMessage());
            FudgeUtils.AssertAllFieldsMatch(msg2, writer.DequeueMessage());
        }
コード例 #2
0
        public void MultipleMessages()
        {
            string json = @"{""name"" : ""fred""} {""number"" : 17}";
            var reader = new FudgeJSONStreamReader(context, json);
            var writer = new FudgeMsgStreamWriter();
            new FudgeStreamPipe(reader, writer).Process();

            Assert.Equal(2, writer.PeekAllMessages().Count);
            Assert.Equal("fred", writer.DequeueMessage().GetString("name"));
            Assert.Equal(17, writer.DequeueMessage().GetInt("number"));
        }