private bool MapEquals <K, V>(MapSet <K, V> left, MapSet <K, V> right) { var result = false; if (!left.Keys.Except(right.Keys).Any() && left.Keys.Count() == right.Keys.Count()) { return(left.All(kv => kv.Value.IsSubsetOf(right[kv.Key])) && right.All(kv => kv.Value.IsSubsetOf(left[kv.Key]))); } return(result); }
public static bool MapLessEquals <K, V>(this MapSet <K, V> left, MapSet <K, V> right) { var result = false; if (!left.Keys.Except(right.Keys).Any() && left.Keys.Count() <= right.Keys.Count()) { return(left.All(kv => kv.Value.All(n => right[kv.Key].Contains(n)))); //&& right.All(kv => kv.Value.IsSubsetOf(left[kv.Key])); } return(result); }