public void WriteDictionary(PropertyDictionary dictionary) { AppendLine("{0}", "{"); Indent(); foreach (object key in dictionary.Keys) { object value = dictionary.ValueFor(key); if (value == null) continue; WriteObject(key); Append(" = "); WriteObject(value); AppendLine(";"); } Dedent(); Append("{0}", "}"); }
void AssertDictionariesEqual(PropertyDictionary left, PropertyDictionary right) { Set<object> leftKeys = new Set<object>(left.Keys); Set<object> rightKeys = new Set<object>(right.Keys); Assert.AreEqual(leftKeys, rightKeys); foreach (object key in leftKeys) { object leftValue = left.ValueFor(key); object rightValue = right.ValueFor(key); } }