Exemplo n.º 1
0
        public void TestDeserialization()
        {
            var expectedUniversalSampler      = new UniversalSampler(5, 20);
            var universalNSamplerJson         = SerializationHelper.JsonSerialize(expectedUniversalSampler);
            var deserializedUniversalNSampler = SerializationHelper.Deserialize <UniversalSampler>(universalNSamplerJson);

            JsonAssert.AreEqual(expectedUniversalSampler, deserializedUniversalNSampler);
        }
Exemplo n.º 2
0
        public void TestSerialize()
        {
            var universalSampler = new UniversalSampler(5, 20);
            var json             = SerializationHelper.JsonSerialize(universalSampler);
            var expectedJson     = @"{
              ""TrainingCount"": 5,
              ""TestCount"": 20
            }";

            JsonAssert.AreEqual(expectedJson, json);
        }