public void TestDeserialization() { var expectedUniversalSampler = new UniversalSampler(5, 20); var universalNSamplerJson = SerializationHelper.JsonSerialize(expectedUniversalSampler); var deserializedUniversalNSampler = SerializationHelper.Deserialize <UniversalSampler>(universalNSamplerJson); JsonAssert.AreEqual(expectedUniversalSampler, deserializedUniversalNSampler); }
public void TestSerialize() { var universalSampler = new UniversalSampler(5, 20); var json = SerializationHelper.JsonSerialize(universalSampler); var expectedJson = @"{ ""TrainingCount"": 5, ""TestCount"": 20 }"; JsonAssert.AreEqual(expectedJson, json); }