public void TestWorkflowAdd() { Workflow wf = new Workflow { Creator = "test add", Name = "testing add", Status = 0, CreateTime = DateTime.Now, WorkflowDefinitionID = "1", }; dao.Add(wf); WorkflowQueryForm form = new WorkflowQueryForm { ID = wf.ID, }; var statement = dao.Mapper.GetMappedStatement("QueryWorkflow"); if (!dao.Mapper.IsSessionStarted) { dao.Mapper.OpenConnection(); } RequestScope scope = statement.Statement.Sql.GetRequestScope(statement, form, dao.Mapper.LocalSession); string result = scope.PreparedStatement.PreparedSql; var list = dao.Query(form); Assert.AreEqual(1, list.Count); Assert.AreEqual("testing add", list[0].Name); Assert.AreEqual("1", list[0].WorkflowDefinitionID); Assert.AreEqual("test add", list[0].Creator); Assert.AreEqual(0, list[0].Status); dao.Delete(form); }
/// <summary> /// 删除该流程 /// </summary> public void Remove() { ISqlMapper mapper = MapperHelper.GetMapper(); WorkflowDao wfdao = new WorkflowDao(mapper); ActivityDao activitydao = new ActivityDao(mapper); LinkDao linkDao = new LinkDao(mapper); ActivityAuthDao authdao = new ActivityAuthDao(mapper); ApprovalDao approvalDao = new ApprovalDao(mapper); TaskDao taskdao = new TaskDao(mapper); string id = this.value.ID; var activities = activitydao.Query(new ActivityQueryForm { WorkflowID = id }); taskdao.Delete(new TaskQueryForm { WorkflowID = id }); wfdao.Delete(new WorkflowQueryForm { ID = id }); activitydao.Delete(new ActivityQueryForm { WorkflowID = id }); linkDao.Delete(new LinkQueryForm { WorkflowID = id }); approvalDao.Delete(new ApprovalQueryForm { WorkflowID = id }); authdao.Delete(new ActivityAuthQueryForm { WorkflowID = id }); }
public void CleanUp() { WorkflowDao dao = new WorkflowDao(); dao.Delete(new WorkflowQueryForm { ID = "1" }); }
public void Init() { WorkflowDao dao = new WorkflowDao(); dao.Delete(new WorkflowQueryForm { ID = "1" }); dao.Add(new Workflow { ID = "1", WorkflowDefinitionID = "1", Name = "UnitTest", CreateTime = DateTime.Now, LastUpdateTime = DateTime.Now, }); }
/// <summary> /// 删除该流程 /// </summary> public void Remove() { ISqlMapper mapper = MapperHelper.GetMapper(); WorkflowDao wfdao = new WorkflowDao(mapper); ActivityDao activitydao = new ActivityDao(mapper); LinkDao linkDao = new LinkDao(mapper); ActivityAuthDao authdao = new ActivityAuthDao(mapper); ApprovalDao approvalDao = new ApprovalDao(mapper); TaskDao taskdao = new TaskDao(mapper); string id = this.value.ID; var activities = activitydao.Query(new ActivityQueryForm { WorkflowID = id }); taskdao.Delete(new TaskQueryForm { WorkflowID = id }); wfdao.Delete(new WorkflowQueryForm { ID = id }); activitydao.Delete(new ActivityQueryForm { WorkflowID = id }); linkDao.Delete(new LinkQueryForm { WorkflowID = id }); approvalDao.Delete(new ApprovalQueryForm { WorkflowID = id }); authdao.Delete(new ActivityAuthQueryForm { WorkflowID = id }); }
public void Init() { WorkflowDao dao = new WorkflowDao(); dao.Delete(new WorkflowQueryForm { ID = "1" }); dao.Add(new Workflow { ID = "1", WorkflowDefinitionID = "1", Name = "UnitTest", CreateTime = DateTime.Now, LastUpdateTime = DateTime.Now, }); }
public void CleanUp() { WorkflowDao dao = new WorkflowDao(); dao.Delete(new WorkflowQueryForm { ID = "1" }); }