Пример #1
0
        public void IsEmpty()
        {
            var item = new OrderByItem();
            Assert.IsTrue(item.IsEmpty);

            item.Field = "test";
            item.Order = SortOrder.Ascending;
            Assert.IsFalse(item.IsEmpty);
            Assert.AreEqual("test", item.GetSql());

            item.Order = SortOrder.Descending;
            Assert.AreEqual("test desc", item.GetSql());
        }
Пример #2
0
        public void Create()
        {
            var item = new OrderByItem("field1", SortOrder.Ascending);
            Assert.AreEqual("field1", item.GetSql());
            Assert.AreEqual("field1", item.ToString());

            item.Order = SortOrder.Descending;
            Assert.AreEqual("field1 desc",item.ToString());

            Assert.IsFalse(item.IsEmpty);
        }