public void Insert() { //Setup Performer performer = new Performer { FirstName = "SLTEST", LastName = "SLTEST" }; PerformerList performers = new PerformerList(); performers.Load(); int originalCount = performers.Count(); //Act HttpClient client = InitializeClient(); //Serialize a performer object that we're trying to insert string serializedPerformer = JsonConvert.SerializeObject(performer); var content = new StringContent(serializedPerformer); content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); HttpResponseMessage response = client.PostAsync("Performer", content).Result; //Assert performers.Clear(); performers.Load(); Assert.AreEqual(originalCount + 1, performers.Count); }
/// <summary> /// 下一步活动 /// </summary> /// <param name="activityGUID">活动节点GUID</param> /// <param name="performerList">执行用户列表</param> /// <returns>服务类</returns> public IWorkflowService NextStep(string activityGUID, PerformerList performerList) { if (performerList != null && performerList.Count() > 0) { _wfAppRunner.NextActivityPerformers.Add(activityGUID, performerList); } else { throw new ApplicationException("下一步办理用户列表不能为空!"); } return(this); }
/// <summary> /// 下一步活动 /// </summary> /// <param name="activityGUID">活动节点GUID</param> /// <param name="performerList">执行用户列表</param> /// <returns>服务类</returns> public IWorkflowService NextStep(string activityGUID, PerformerList performerList) { if (performerList != null && performerList.Count() > 0) { _wfAppRunner.NextActivityPerformers.Add(activityGUID, performerList); } else { throw new ApplicationException(LocalizeHelper.GetEngineMessage("workflowservice.nextstep.error")); } return(this); }
public void Delete() { //Setup PerformerList performers = new PerformerList(); performers.Load(); int originalCount = performers.Count(); Performer performer = performers.FirstOrDefault(c => c.FirstName == "SLTEST1"); //Act if (performer != null) { HttpClient client = InitializeClient(); HttpResponseMessage response = client.DeleteAsync("Performer/" + performer.Id).Result; } //Assert performers.Clear(); performers.Load(); Assert.AreEqual(originalCount - 1, performers.Count); }