Example #1
0
 protected void AssertSerializedRequest <TRequest>(
     TRequest request,
     string serialized
     ) where TRequest : Request
 {
     using (var ms = new StringMemoryStream())
     {
         Serializer.JsonSerialize(ms, request);
         Assert.AreEqual(serialized, ms.ToDecodedString());
     }
 }
Example #2
0
        public void TestJsonSerialize()
        {
            string result;

            using (var stream = new StringMemoryStream()) {
                Serializer.JsonSerialize(stream, Dummy);
                result = stream.ToDecodedString();
            }

            Assert.AreEqual(DummyJson, result);
        }