Exemplo n.º 1
0
        public void GetRequestLevel1_Test()
        {
            busKartabl = new BKartabl(ADOPerson1.ID, ADOUser1.ID, ADOUser1.UserName);
            IList <KartablProxy> list = busKartabl.GetAllRequests(RequestType.None, 1389, 2, 0, 10, KartablOrderBy.RegisteredBy);

            Assert.AreEqual(1, list.Count);
        }
Exemplo n.º 2
0
        public void GetAllRequest_Simple_Test()
        {
            busKartabl = new BKartabl(ADOPerson6.ID, ADOUser6.ID, ADOUser6.UserName);
            IList <KartablProxy> list = busKartabl.GetAllRequests(RequestType.None, 1389, 2, 0, 20, KartablOrderBy.RegisteredBy);

            Assert.AreEqual(1, list.Count);
            Assert.AreEqual(ADORequestDailyLeave1.ID, list.First().RequestID);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        public void GetAllRequest_SubstituteFor2Manager_Test()
        {
            busKartabl = new BKartabl(ADOPerson5.ID, ADOUser5.ID, ADOUser5.UserName);
            IList <KartablProxy> list = busKartabl.GetAllRequests(RequestType.None, 1389, 2, 0, 20, KartablOrderBy.RegisteredBy);

            Assert.AreEqual(3, list.Count);
            Assert.IsTrue(list.Where(x => x.ID == ADORequestDailyLeave1.ID).Count() == 1);
            Assert.IsTrue(list.Where(x => x.ID == ADORequestHourlyDuty2.ID).Count() == 1);
            Assert.IsTrue(list.Where(x => x.ID == ADORequestHourlyDuty3.ID).Count() == 1);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }