public void SetStatus_ConfirmEnflow_UniquePermitCheck_Test() { busKartabl = new BKartabl(ADOPerson1.ID, ADOUser1.ID, ADOUser1.UserName); KartableSetStatusProxy proxy = new KartableSetStatusProxy(ADORequestHourlyDuty2.ID, ADOManagerFlow2.ID); IList <KartableSetStatusProxy> list = new List <KartableSetStatusProxy>(); list.Add(proxy); bool result = busKartabl.SetStatusOfRequest(list, RequestState.Confirmed, ""); ClearSession(); proxy = new KartableSetStatusProxy(ADORequestHourlyDuty3.ID, ADOManagerFlow2.ID); list = new List <KartableSetStatusProxy>(); list.Add(proxy); result = busKartabl.SetStatusOfRequest(list, RequestState.Confirmed, ""); DatasetGatewayWorkFlow.TA_PermitPairDataTable table = permitPairTA.GetDataByRequestId(ADORequestHourlyDuty2.ID); decimal firstPErmitID = Convert.ToDecimal(table.Rows[0]["permit_ID"]); Assert.AreEqual(ADORequestHourlyDuty2.FromDate, Convert.ToDateTime(table.Rows[0]["permit_fromdate"])); Assert.AreEqual(1, table.Rows.Count); table = permitPairTA.GetDataByRequestId(ADORequestHourlyDuty3.ID); decimal secondPErmitID = Convert.ToDecimal(table.Rows[0]["permit_ID"]); Assert.AreEqual(1, table.Rows.Count); Assert.AreEqual(firstPErmitID, secondPErmitID); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
public void SetStatus_ConfirmNotEnflow_PermitCheck_Test() { busKartabl = new BKartabl(ADOPerson1.ID, ADOUser1.ID, ADOUser1.UserName); KartableSetStatusProxy proxy = new KartableSetStatusProxy(ADORequestTraffic1.ID, ADOManagerFlow1.ID); IList <KartableSetStatusProxy> list = new List <KartableSetStatusProxy>(); list.Add(proxy); bool result = busKartabl.SetStatusOfRequest(list, RequestState.Confirmed, ""); DatasetGatewayWorkFlow.TA_PermitPairDataTable table = permitPairTA.GetDataByRequestId(ADORequestDailyLeave1.ID); Assert.AreEqual(0, table.Rows.Count); }
public void SetStatusBySubstitute_ConfirmEnflow_PermitCheck_Test() { busKartabl = new BKartabl(ADOPerson6.ID, ADOUser6.ID, ADOUser6.UserName); KartableSetStatusProxy proxy = new KartableSetStatusProxy(ADORequestDailyLeave1.ID, ADOManagerFlow3.ID); IList <KartableSetStatusProxy> list = new List <KartableSetStatusProxy>(); list.Add(proxy); bool result = busKartabl.SetStatusOfRequest(list, RequestState.Confirmed, ""); DatasetGatewayWorkFlow.TA_PermitPairDataTable table = permitPairTA.GetDataByRequestId(ADORequestDailyLeave1.ID); Assert.AreEqual(ADORequestDailyLeave1.FromDate, Convert.ToDateTime(table.Rows[0]["permit_fromdate"])); Assert.AreEqual(1, table.Rows.Count); }
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); }
public void DeleteRequest_PermitCheck() { UpdateCurrentUserPersonId(ADOPerson1.ID); busKartabl = new BKartabl(); KartableSetStatusProxy proxy = new KartableSetStatusProxy(ADORequestDailyLeave1.ID, ADOManagerFlow3.ID); IList <KartableSetStatusProxy> list = new List <KartableSetStatusProxy>(); list.Add(proxy); bool result = busKartabl.SetStatusOfRequest(list, RequestState.Confirmed, ""); DatasetGatewayWorkFlow.TA_PermitPairDataTable table = permitPairTA.GetDataByRequestId(ADORequestDailyLeave1.ID); Assert.AreEqual(1, table.Rows.Count); ClearSession(); busReviewd.DeleteRequst(ADORequestDailyLeave1.ID, ""); table = permitPairTA.GetDataByRequestId(ADORequestDailyLeave1.ID); Assert.AreEqual(0, table.Rows.Count); }
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); }