public void Can_Serialize_And_Deserialize_DataContract_Classes()
        {
            var ser = new JsonSerializer();
            var str = new MemoryStream();
            var contract = new TestContract {PropertyOne = "propertyOne", PropertyTwo = 42};
            ser.Serialize(str, contract);

            str.Seek(0, SeekOrigin.Begin);
            var resultContract = ser.Deserialize<TestContract>(str);
            Assert.AreEqual(contract.PropertyOne, resultContract.PropertyOne);
            Assert.AreEqual(contract.PropertyTwo, resultContract.PropertyTwo);
        }
        public void Cannot_Deserialize_Without_Type_Parameter()
        {
            var ser = new JsonSerializer();
            var str = new MemoryStream();
            var contract = new TestContract { PropertyOne = "propertyOne", PropertyTwo = 42 };
            ser.Serialize(str, contract);

            str.Seek(0, SeekOrigin.Begin);
            try
            {
                ser.Deserialize(str);
                Assert.Fail("Should have thrown an exception.");
            }
            catch (NotImplementedException)
            {
                // Expected result.
            }
        }