Beispiel #1
0
        public void TwoMoreThenThreeForAscendingInText()
        {
            comparer = new TextComparer(System.ComponentModel.ListSortDirection.Ascending);
            int compareResult = comparer.Compare("two", "three");

            Assert.AreEqual(1, compareResult);
        }
Beispiel #2
0
        public void FalseMoreThenTrueForDescendingInBoolean()
        {
            comparer = new BooleanComparer(System.ComponentModel.ListSortDirection.Descending);
            int compareResult = comparer.Compare(false.ToString(), true.ToString());

            Assert.AreEqual(1, compareResult);
        }
Beispiel #3
0
        public void Text2MoreThanText11ForDescendingInNatural()
        {
            comparer = new NaturalComparer(System.ComponentModel.ListSortDirection.Descending);
            int compareResult = comparer.Compare("text2", "text11");

            Assert.AreEqual(1, compareResult);
        }
Beispiel #4
0
        public void TodayMoreThenTomorrowForDescendingInText()
        {
            comparer = new DateComparer(System.ComponentModel.ListSortDirection.Descending);
            int compareResult = comparer.Compare(DateTime.Now.ToString(), DateTime.Now.AddDays(1).ToString());

            Assert.AreEqual(1, compareResult);
        }
Beispiel #5
0
        public void TwoMoreThenThreeForDescendingInNumber()
        {
            comparer = new NumberComparer(System.ComponentModel.ListSortDirection.Descending);
            int compareResult = comparer.Compare(2.ToString(), 3.ToString());

            Assert.AreEqual(1, compareResult);
        }
Beispiel #6
0
        public void FalseLessThanTrueInBoolean()
        {
            int compareResult = comparer.Compare(false.ToString(), true.ToString());

            Assert.AreEqual(-1, compareResult);
        }
Beispiel #7
0
        public void Text1EqualsText1InNatural()
        {
            int compareResult = comparer.Compare("text1", "text1");

            Assert.AreEqual(0, compareResult);
        }
Beispiel #8
0
        public void TodayLessThanTomorrowInDate()
        {
            int compareResult = comparer.Compare(DateTime.Now.ToString(), DateTime.Now.AddDays(1).ToString());

            Assert.AreEqual(-1, compareResult);
        }
Beispiel #9
0
        public void NullLessThanFive()
        {
            int compareResult = comparer.Compare(null, 5.ToString());

            Assert.AreEqual(-1, compareResult);
        }
Beispiel #10
0
        public void TwoMoreThanThreeInText()
        {
            int compareResult = comparer.Compare("two", "three");

            Assert.AreEqual(1, compareResult);
        }
Beispiel #11
0
        public void TwoLessThanThreeInNumber()
        {
            int compareResult = comparer.Compare(2.ToString(), 3.ToString());

            Assert.AreEqual(-1, compareResult);
        }