public void TestToSortDirection_Ascending()
        {
            var key           = SortDirection.Ascending.Value;
            var testDirection = SortDirection.ToSortDirection(key);

            Assert.AreEqual(SortDirection.Ascending, testDirection);
        }
Example #2
0
 /// <summary>
 /// Returns a string of this simple sorter.
 /// </summary>
 /// <returns>A string of this simple sorter.</returns>
 public override string ToString()
 {
     return(String.Format("{0}:{1}", this.Property, SortDirection.ToSortDirection(this.Direction).Value));
 }
        public void TestToSortDirection_CaseInsensitiveTest()
        {
            var key = "AsC";

            Assert.AreEqual(SortDirection.Ascending, SortDirection.ToSortDirection(key));
        }
Example #4
0
        /// <summary>
        /// Returns a LinqSorter of this simple sorter.
        /// </summary>
        /// <typeparam name="T">The type to sort on.</typeparam>
        /// <returns>The linq sorter.</returns>
        public LinqSorter <T> ToLinqSorter <T>() where T : class
        {
            var direction = SortDirection.ToSortDirection(this.Direction);

            return(new LinqSorter <T>(this.Property, direction));
        }