Exemplo n.º 1
0
        public void ToStringAndHashCodeTest()
        {
            SortDescription sd = new SortDescription("Sample", ListSortDirection.Ascending);

            Assert.AreEqual("System.ComponentModel.SortDescription", sd.ToString(), "TSHC_#1");
            Assert.AreEqual("Sample".GetHashCode() ^ ListSortDirection.Ascending.GetHashCode(),
                            sd.GetHashCode(), "TSHC_#2");

            sd = new SortDescription("Sample", ListSortDirection.Descending);

            Assert.AreEqual("Sample".GetHashCode() ^ ListSortDirection.Descending.GetHashCode(),
                            sd.GetHashCode(), "TSHC_#3");

            sd = new SortDescription(null, ListSortDirection.Descending);

            Assert.AreEqual(ListSortDirection.Descending.GetHashCode(), sd.GetHashCode( ), "TSHC_#4");
        }