コード例 #1
0
        public void TestDeserializeFromJson()
        {
            var expected = new ExposureConfiguration.GoogleDiagnosisKeysDataMappingConfiguration();
            var googleDiagnosisKeysDataMappingConfiguration = Utils
                                                              .ReadObjectFromJsonPath <ExposureConfiguration.GoogleDiagnosisKeysDataMappingConfiguration>(PATH_JSON);

            Assert.True(expected.Equals(googleDiagnosisKeysDataMappingConfiguration));
        }
コード例 #2
0
        public void TestNotEquals()
        {
            var expected = new ExposureConfiguration.GoogleDiagnosisKeysDataMappingConfiguration
            {
                InfectiousnessWhenDaysSinceOnsetMissing = Infectiousness.None
            };

            var googleDiagnosisKeysDataMappingConfiguration = Utils
                                                              .ReadObjectFromJsonPath <ExposureConfiguration.GoogleDiagnosisKeysDataMappingConfiguration>(PATH_JSON);

            Assert.False(expected.Equals(googleDiagnosisKeysDataMappingConfiguration));
        }
コード例 #3
0
        public void TestSerializeToJson()
        {
            var googleDiagnosisKeysDataMappingConfiguration = new ExposureConfiguration.GoogleDiagnosisKeysDataMappingConfiguration();
            var jsonStr = JsonConvert.SerializeObject(googleDiagnosisKeysDataMappingConfiguration, Formatting.Indented);

            //Logger.D(jsonStr);

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

                Assert.AreEqual(expected, jsonStr);
            }
        }