Ejemplo n.º 1
0
        public void TestDeserialization()
        {
            var expectedEvenNSampler = new EvenNSampler {
                N = 10
            };
            var evenNSamplerJson         = SerializationHelper.JsonSerialize(expectedEvenNSampler);
            var deserializedEvenNSampler = SerializationHelper.Deserialize <EvenNSampler>(evenNSamplerJson);

            JsonAssert.AreEqual(expectedEvenNSampler, deserializedEvenNSampler);
        }
Ejemplo n.º 2
0
        public void TestSerialize()
        {
            var evenNSampler = new EvenNSampler {
                N = 10
            };
            var json         = SerializationHelper.JsonSerialize(evenNSampler);
            var expectedJson = @"{
              ""N"": 10
            }";

            JsonAssert.AreEqual(expectedJson, json);
        }