Azavea.Open.DAO.Tests.CriteriaTests.TestOrders C# (CSharp) Method

TestOrders() private method

private TestOrders ( ) : void
return void
        public void TestOrders()
        {
            DaoCriteria sc = new DaoCriteria();
            Assert.AreEqual(0, sc.Orders.Count, "Didn't start with none.");
            sc.Orders.Add(new SortOrder("X", SortType.Asc));
            Assert.AreEqual(1, sc.Orders.Count, "Didn't add the asc one.");
            sc.Orders.Add(new SortOrder("A", SortType.Desc));
            Assert.AreEqual(2, sc.Orders.Count, "Didn't add the desc one.");
            sc.Orders.Add(new SortOrder("Z", SortType.Computed));
            Assert.AreEqual(3, sc.Orders.Count, "Didn't add the computed one.");
            Assert.AreEqual("X", sc.Orders[0].Property, "Wrong order first");
            Assert.AreEqual("A", sc.Orders[1].Property, "Wrong order second");
            Assert.AreEqual("Z", sc.Orders[2].Property, "Wrong order third");
            Assert.AreEqual(SortType.Asc, sc.Orders[0].Direction, "Wrong sort dir first");
            Assert.AreEqual(SortType.Desc, sc.Orders[1].Direction, "Wrong sort dir second");
            Assert.AreEqual(SortType.Computed, sc.Orders[2].Direction, "Wrong sort dir third");
            sc.Orders.Clear();
            Assert.AreEqual(0, sc.Orders.Count, "Didn't clear.");
            sc.Orders.Add(new SortOrder("X", SortType.Asc));
            Assert.AreEqual(1, sc.Orders.Count, "Didn't add one after clearing.");
        }