////ncrunch: no coverage end
        protected bool Equals(AdHocOrderSpecification <TEntity> other)
        {
            if (!this.IsReferenceEquals(other))
            {
                return(false);
            }

            if (this.expressions.Count != other.expressions.Count)
            {
                Console.WriteLine(Resources.AdHocOrderSpecification_Equal_diffrent_count_expressions.F(this.expressions.Count, other.expressions.Count));
                return(false);
            }

            for (int i = 0; i < this.expressions.Count; i++)
            {
                if (!this.expressions[i].Item1.IsExpressionEqual(other.expressions[i].Item1))
                {
                    Console.WriteLine(Resources.AdHocOrderSpecification_Equal_diffrent_expressions.F(this.expressions[i].Item1, other.expressions[i].Item1));
                    return(false);
                }

                if (this.expressions[i].Item2 != other.expressions[i].Item2)
                {
                    Console.WriteLine(Resources.AdHocOrderSpecification_Equal_diffrent_type.F(this.expressions[i].Item2, other.expressions[i].Item2));
                    return(false);
                }
            }

            return(true);
        }
コード例 #2
0
        ////ncrunch: no coverage end
        protected bool Equals(OrderSpecification <TEntity> other)
        {
            ////ncrunch: no coverage start
            if (!this.IsReferenceEquals(other))
            {
                return(false);
            }

            ////ncrunch: no coverage end
            var leftOrder = new AdHocOrderSpecification <TEntity>();

            SortedBy()(leftOrder);

            var rightOrder = new AdHocOrderSpecification <TEntity>();

            other.SortedBy()(rightOrder);

            return(leftOrder.Equals(rightOrder));
        }