public void DictionaryTupleDeserializeFromJSON(DictionaryTupleTestData inTestData) { var obj = Fixture.Serializer.Deserialize <(string k1, Dictionary <string, double> dict)>(inTestData.SerializedTestData); obj.Should().BeOfType(typeof((string k1, Dictionary <string, double> dict))); obj.Should().Equals(inTestData.ObjTestData); // ToDo: add a helper method to Collections that will compare two dictionaries (including case) for equality // ToDo: extend test to compare every element of the two dictionaries //(string k1, Dictionary<string, double> term1) r = InputMethodsForDealingWithJSONFormattedStrings.DeSerializeDictionaryTuple(inTestData); //var x = (k1: "k1", term1: new Dictionary<string, double>() { { "c1", 10.0 } }); //bool passed = (r.k1 == x.k1) && (r.term1.Count == x.term1.Count); // ToDo: figure out a link query that will produce "false" if the keys and values of both dictionaries are not the same // bool t = r.Item2.Where(d => x.Item2.ContainsKey(r.Item2.Key) && //Assert.True(passed); }
public void DictionaryTupleSerializeToJSON(DictionaryTupleTestData inTestData) { Fixture.Serializer.Serialize(inTestData.ObjTestData).Should().Be(inTestData.SerializedTestData); }