예제 #1
0
        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);
        }
예제 #2
0
        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);
        }