Exemplo n.º 1
0
        public void OperatorTest()
        {
            SortDescription left     = new SortDescription("A", ListSortDirection.Ascending);
            SortDescription same     = new SortDescription("A", ListSortDirection.Ascending);
            SortDescription diffProp = new SortDescription("B", ListSortDirection.Ascending);
            SortDescription diffDir  = new SortDescription("A", ListSortDirection.Descending);

            Assert.IsTrue(left == same, "OP_#1");
            Assert.IsFalse(left == diffProp, "OP_#2");
            Assert.IsFalse(left == diffDir, "OP_#3");
            Assert.IsFalse(left == null, "OP_#4");

            Assert.IsFalse(left != same, "OP_#5");
            Assert.IsTrue(left != diffProp, "OP_#6");
            Assert.IsTrue(left != diffDir, "OP_#7");
            Assert.IsTrue(left != null, "OP_#8");

            Assert.IsTrue(left.Equals(same), "OP_#9");
            Assert.IsFalse(left.Equals(diffProp), "OP_#10");
            Assert.IsFalse(left.Equals(diffDir), "OP_#11");
            Assert.IsFalse(left.Equals(null), "OP_#12");
        }