public void CompareDifferentTest(Expression x, Expression y, Expression z)
        {
            var comparer = new ExpressionTreeComparer();
            var list     = new List <Expression>
            {
                x, y, z
            };

            list.Sort(comparer);
            list.Select(expr => expr.GetHashCode()).Distinct().Should().HaveCount(3);
            comparer.Compare(list[0], list[1]).Should().BeLessThan(0);
            comparer.Compare(list[0], list[2]).Should().BeLessThan(0);
            comparer.Compare(list[1], list[2]).Should().BeLessThan(0);
            comparer.Compare(list[1], list[0]).Should().BeGreaterThan(0);
            comparer.Compare(list[2], list[0]).Should().BeGreaterThan(0);
            comparer.Compare(list[2], list[1]).Should().BeGreaterThan(0);
        }
        public void CompareSameTest(Expression x, Expression y, Expression z)
        {
            var comparer = new ExpressionTreeComparer();
            var xy       = comparer.Compare(x, y);
            var xz       = comparer.Compare(x, z);
            var yz       = comparer.Compare(y, z);
            var yx       = comparer.Compare(y, x);
            var zx       = comparer.Compare(z, x);
            var zy       = comparer.Compare(z, y);
            var results  = new List <int>
            {
                xy, zx, yz, xz, yx, zy
            };
            var hashes = new List <int> {
                x.GetHashCode(), y.GetHashCode(), z.GetHashCode()
            };

            hashes.Distinct().Should().HaveCount(1);
            results.All(r => r == 0).Should().BeTrue();
        }