public void deserialize_with_data_contract_json_serializer()
        {
            var serializer = new DataContractJsonSerializer(typeof (Message));
            var stream = new MemoryStream();
            serializer.WriteObject(stream, message);
            stream.Position = 0;

            string json = new StreamReader(stream).ReadToEnd();
            data.JsonInputIs(json);

            var reader = new DataContractJsonReader(data);
            executeBehavior(reader);

            assertThatTheMessageIsStoredIntoFubuRequest();
        }
示例#2
0
        public void deserialize_with_data_contract_json_serializer()
        {
            var serializer = new DataContractJsonSerializer(typeof(Message));
            var stream     = new MemoryStream();

            serializer.WriteObject(stream, message);
            stream.Position = 0;

            string json = new StreamReader(stream).ReadToEnd();

            data.JsonInputIs(json);

            var reader = new DataContractJsonReader(data);

            executeBehavior(reader);

            assertThatTheMessageIsStoredIntoFubuRequest();
        }