public void TestDeserializeFromJson() { var expected = new ExposureConfiguration.GoogleDiagnosisKeysDataMappingConfiguration(); var googleDiagnosisKeysDataMappingConfiguration = Utils .ReadObjectFromJsonPath <ExposureConfiguration.GoogleDiagnosisKeysDataMappingConfiguration>(PATH_JSON); Assert.True(expected.Equals(googleDiagnosisKeysDataMappingConfiguration)); }
public void TestNotEquals() { var expected = new ExposureConfiguration.GoogleDiagnosisKeysDataMappingConfiguration { InfectiousnessWhenDaysSinceOnsetMissing = Infectiousness.None }; var googleDiagnosisKeysDataMappingConfiguration = Utils .ReadObjectFromJsonPath <ExposureConfiguration.GoogleDiagnosisKeysDataMappingConfiguration>(PATH_JSON); Assert.False(expected.Equals(googleDiagnosisKeysDataMappingConfiguration)); }
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); } }