Ejemplo n.º 1
0
        public void Equals()
        {
            DataSourceSelectArguments arg1 = new DataSourceSelectArguments();
            DataSourceSelectArguments arg2 = DataSourceSelectArguments.Empty;

            Assert.IsTrue(arg1.Equals(arg2), "Equals#1");
            Assert.IsTrue(arg1.GetHashCode() == arg2.GetHashCode(), "GetHashCode#1");

            arg1.SortExpression        = "sort";
            arg1.MaximumRows           = 10;
            arg1.StartRowIndex         = 5;
            arg1.RetrieveTotalRowCount = true;
            arg1.TotalRowCount         = 30;

            Assert.IsFalse(arg1.Equals(arg2), "Equals#2");
            Assert.IsFalse(arg1.GetHashCode() == arg2.GetHashCode(), "GetHashCode#2");

            arg2.SortExpression = "sort";
            arg2.MaximumRows    = 10;
            arg2.StartRowIndex  = 5;

            Assert.IsFalse(arg1.Equals(arg2), "Equals#3");
            Assert.IsFalse(arg1.GetHashCode() == arg2.GetHashCode(), "GetHashCode#3");

            arg2.RetrieveTotalRowCount = true;
            arg2.TotalRowCount         = 30;

            Assert.IsTrue(arg1.Equals(arg2), "Equals#4");
            Assert.IsTrue(arg1.GetHashCode() == arg2.GetHashCode(), "GetHashCode#4");
        }