public void ExsitsProcessKeyTest() { WfClientProcessDescriptor descriptor = OperationHelper.PrepareSimpleProcess(); string key = descriptor.Key; string key2 = Guid.NewGuid().ToString(); bool istrue = WfClientProcessDescriptorServiceProxy.Instance.ExsitsProcessKey(key); Assert.AreEqual(true, istrue); istrue = WfClientProcessDescriptorServiceProxy.Instance.ExsitsProcessKey(key2); Assert.AreEqual(false, istrue); OperationHelper.ClearProcessDescriptorSqlServerData(key); }
public void QueryProcessDescriptorInfoTest() { //建立流程 int totalIndex = -1; int pageSize = 1; Dictionary <string, WfClientProcessDescriptor> dic = new Dictionary <string, WfClientProcessDescriptor>(); WfClientProcessDescriptor descriptor = OperationHelper.PrepareSimpleProcess(); string key = descriptor.Key; dic.Add(key, descriptor); WfClientProcessDescriptor descriptor1 = OperationHelper.PrepareSimpleProcess(); string key1 = descriptor1.Key; dic.Add(key1, descriptor1); string orderby = "CREATE_TIME"; string where = string.Format(" {0}='{1}' or {0}='{2}' ", "PROCESS_KEY", key, key1); //获取子流程 WfClientProcessDescriptorInfoPageQueryResult result = WfClientProcessDescriptorServiceProxy.Instance.QueryProcessDescriptorInfo( 0, pageSize, where, orderby, totalIndex); totalIndex = result.TotalCount; //检查 Assert.AreEqual(totalIndex, dic.Count); //分页是否正确,分支流程个数是否正确 Assert.AreEqual(pageSize, result.QueryResult.Count); //检查排序 Assert.AreEqual(descriptor.Key, result.QueryResult[0].ProcessKey); //分页数据 result = WfClientProcessDescriptorServiceProxy.Instance.QueryProcessDescriptorInfo( 1, pageSize, where, orderby, totalIndex); Assert.AreEqual(descriptor1.Key, result.QueryResult[0].ProcessKey);//第一条加入的信息在第二页 //清理数据 foreach (var item in dic) { OperationHelper.ClearProcessDescriptorSqlServerData(item.Key); } }