示例#1
0
        public void GetRequestCountLevel2_Test()
        {
            busKartabl = new BKartabl(ADOPerson2.ID, ADOUser2.ID, ADOUser2.UserName);
            int count = busKartabl.GetRequestCount(RequestType.None, 1389, 2);

            Assert.AreEqual(2, count);
        }
示例#2
0
        public void GetCount_SubstituteFor2Manager_Test()
        {
            busKartabl = new BKartabl(ADOPerson5.ID, ADOUser5.ID, ADOUser5.UserName);
            int count = busKartabl.GetRequestCount(RequestType.None, 1389, 2);

            Assert.AreEqual(3, count);
        }
示例#3
0
        public void GetCount_Simple_Test()
        {
            busKartabl = new BKartabl(ADOPerson6.ID, ADOUser6.ID, ADOUser6.UserName);
            int count = busKartabl.GetRequestCount(RequestType.None, 1389, 2);

            Assert.AreEqual(1, count);
        }
示例#4
0
        public void SetStatus_ConfirmTest()
        {
            busKartabl = new BKartabl(ADOPerson1.ID, ADOUser1.ID, ADOUser1.UserName);
            int count1 = busKartabl.GetRequestCount(RequestType.None, 1389, 2);
            IList <KartablProxy> list = busKartabl.GetAllRequests(RequestType.None, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);

            Assert.AreEqual(1, count1);
            Assert.AreEqual(1, list.Count);
            var reqList = from o in list
                          select new KartableSetStatusProxy(o.RequestID, o.ManagerFlowID);
            bool result = busKartabl.SetStatusOfRequest(reqList.ToList <KartableSetStatusProxy>(), RequestState.Confirmed, "");

            Assert.IsTrue(result);
            count1 = busKartabl.GetRequestCount(RequestType.None, 1389, 2);
            list   = busKartabl.GetAllRequests(RequestType.None, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);
            Assert.AreEqual(0, count1);
            Assert.AreEqual(0, list.Count);
        }
示例#5
0
        public void GetAllRequest_QuickSearch_SubstituteFor2Manager_Test()
        {
            UpdateCurrentUserPersonId(ADOPerson5.ID);

            busKartabl = new BKartabl(ADOPerson5.ID, ADOUser5.ID, ADOUser5.UserName);
            int count = busKartabl.GetRequestCount("003", 1389, 2);
            IList <KartablProxy> list = busKartabl.GetAllRequests("003", 1389, 2, 0, 20, KartablOrderBy.RegisteredBy);

            Assert.AreEqual(count, list.Count);
            Assert.AreEqual(3, count);
        }
示例#6
0
        public void SetStatus_UnConfirmTest()
        {
            busKartabl = new BKartabl(ADOPerson1.ID, ADOUser1.ID, ADOUser1.UserName);
            int count1 = busKartabl.GetRequestCount(RequestType.None, 1389, 2);
            IList <KartablProxy> list = busKartabl.GetAllRequests(RequestType.None, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);

            Assert.AreEqual(1, count1);
            Assert.AreEqual(1, list.Count);
            var reqList = from o in list
                          select new KartableSetStatusProxy(o.RequestID, o.ManagerFlowID);
            bool result = busKartabl.SetStatusOfRequest(reqList.ToList <KartableSetStatusProxy>(), RequestState.Unconfirmed, "");

            Assert.IsTrue(result);
            count1 = busKartabl.GetRequestCount(RequestType.None, 1389, 2);

            DatasetGatewayWorkFlow.TA_PermitPairDataTable table = permitPairTA.GetDataByRequestId(list[0].ID);
            Assert.AreEqual(0, table.Rows.Count);

            list = busKartabl.GetAllRequests(RequestType.None, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);
            Assert.AreEqual(0, count1);
            Assert.AreEqual(0, list.Count);
        }