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); }
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); }
public void DeleteRequest_test() { try { UpdateCurrentUserPersonId(ADOPerson1.ID); busReviewd = new BKartabl(); IList <KartablProxy> list = busReviewd.GetAllRequests(RequestState.UnKnown, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy); Assert.AreEqual(6, list.Count); decimal id = list[0].ID; busReviewd.DeleteRequst(id, ""); ClearSession(); request_testObject = new BRequest().GetByID(id); Assert.AreEqual(1, request_testObject.RequestStatusList.Where(x => x.IsDeleted).Count()); } catch (Exception ex) { Assert.Fail(ex.Message); } }
public void DeleteRequest_LevelTest() { try { UpdateCurrentUserPersonId(ADOPerson1.ID); busReviewd = new BKartabl(); IList <KartablProxy> list = busReviewd.GetAllRequests(RequestState.UnKnown, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy); Assert.AreEqual(6, list.Count); decimal id = list[0].ID; busReviewd.DeleteRequst(id, ""); ClearSession(); IList <KartablFlowLevelProxy> l = busKartabl.GetRequestLevelsByManagerFlowID(id, list[0].ManagerFlowID); int count = l.Where(x => x.RequestStatus != RequestState.Deleted).Count(); Assert.Greater(l.Count, 0); Assert.AreEqual(1, count); } catch (Exception ex) { Assert.Fail(ex.Message); } }