Ejemplo n.º 1
0
        public void GetAllRequests_QuickSearchTest()
        {
            UpdateCurrentUserPersonId(ADOPerson1.ID);

            busReviewd = new BKartabl(ADOPerson1.ID, ADOUser1.ID, ADOUser1.UserName);
            int count1 = busReviewd.GetRequestCount("006", 1389, 2);
            IList <KartablProxy> list = busReviewd.GetAllRequests("006", 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);

            Assert.AreEqual(count1, list.Count);
            Assert.AreEqual(1, list.Count);
        }
Ejemplo n.º 2
0
        public void GetAllRequests_ConfirmTest()
        {
            busReviewd = new BKartabl(ADOPerson1.ID, ADOUser1.ID, ADOUser1.UserName);
            int count1 = busReviewd.GetRequestCount(RequestState.UnKnown, 1389, 2);
            IList <KartablProxy> list = busReviewd.GetAllRequests(RequestState.UnKnown, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);

            Assert.AreEqual(count1, list.Count);
            Assert.IsTrue(list.Where(x => x.ID == ADORequestTraffic1.ID).Count() == 0);
            Assert.IsTrue(list.Where(x => x.ID == ADORequestHourlyDuty1.ID).Count() >= 1);

            int count2 = busReviewd.GetRequestCount(RequestState.Confirmed, 1389, 2);

            list = busReviewd.GetAllRequests(RequestState.Confirmed, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);
            Assert.AreEqual(count2, list.Count);
            Assert.IsTrue(list.Where(x => x.ID == ADORequestHourlyLeave2.ID).Count() >= 1);
            Assert.IsTrue(list.Where(x => x.ID == ADORequestHourlyDuty1.ID).Count() == 0);

            int count3 = busReviewd.GetRequestCount(RequestState.Unconfirmed, 1389, 2);

            list = busReviewd.GetAllRequests(RequestState.Unconfirmed, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);
            Assert.AreEqual(count3, list.Count);
            Assert.IsTrue(list.Where(x => x.ID == ADORequestHourlyDuty1.ID).Count() >= 1);
            Assert.IsTrue(list.Where(x => x.ID == ADORequestHourlyLeave2.ID).Count() == 0);
        }