예제 #1
0
        public void TestDeserializeFromJson()
        {
            var expected = new ExposureConfiguration.AppleExposureConfigurationV2();
            var appleExposureV2Configuration = Utils.ReadObjectFromJsonPath <ExposureConfiguration.AppleExposureConfigurationV2>(PATH_JSON);

            Assert.True(expected.Equals(appleExposureV2Configuration));
        }
예제 #2
0
        public void TestNotEquals()
        {
            var expected = new ExposureConfiguration.AppleExposureConfigurationV2
            {
                ImmediateDurationWeight = 20
            };

            var appleExposureV2Configuration = Utils.ReadObjectFromJsonPath <ExposureConfiguration.AppleExposureConfigurationV2>(PATH_JSON);

            Assert.False(expected.Equals(appleExposureV2Configuration));
        }
예제 #3
0
        public void TestSerializeToJson()
        {
            var appleExposureConfigurationV2 = new ExposureConfiguration.AppleExposureConfigurationV2();
            var jsonStr = JsonConvert.SerializeObject(appleExposureConfigurationV2, Formatting.Indented);

            //Logger.D(jsonStr);

            using (var sr = new StreamReader(File.OpenRead(Utils.GetFullPath(PATH_JSON))))
            {
                var expected = sr.ReadToEnd();

                Assert.AreEqual(expected, jsonStr);
            }
        }