public void Initialize() { InitializeMock(); workflowHeaders = new List <WorkflowHeaderModel>(); workflowHeaderModelForSuccess = new WorkflowHeaderModel() { RecordHeaderID = 1001, ContactID = 1, FirstName = "kishan", LastName = "mootha", WorkflowDataKey = "Registration-Registration-Demographics", }; workflowHeaders.Add(workflowHeaderModelForSuccess); //get Screen Audits Response <WorkflowHeaderModel> workflowHeaderReponse = new Response <WorkflowHeaderModel>(); workflowHeaderReponse.DataItems = workflowHeaders; workflowHeaderReponse.RowAffected = 1; mock.Setup(r => r.AddWorkflowHeader(It.IsAny <WorkflowHeaderModel>())) .Callback((WorkflowHeaderModel workflowHeaderModel) => { if (workflowHeaderModel.RecordHeaderID > 0) { workflowHeaders.Add(workflowHeaderModel); } }) .Returns(workflowHeaderReponse); }
public Response <WorkflowHeaderModel> AddWorkflowHeader(WorkflowHeaderModel workflowHeader) { SqlParameter workflowKeyParam = new SqlParameter("WorkflowDataKey", workflowHeader.WorkflowDataKey); SqlParameter headerIDParam = new SqlParameter("RecordPrimaryKeyValue", workflowHeader.RecordHeaderID); SqlParameter contactIDParam = new SqlParameter("ContactID", workflowHeader.ContactID); SqlParameter modifiedOnParam = new SqlParameter("ModifiedOn", DateTime.Now); List <SqlParameter> procParams = new List <SqlParameter>() { workflowKeyParam, headerIDParam, contactIDParam, modifiedOnParam }; var repository = _unitOfWork.GetRepository <WorkflowHeaderModel>(SchemaName.Core); return(_unitOfWork.EnsureInTransaction( repository.ExecuteNQStoredProc, "usp_SaveRecordHeader", procParams )); }
public void AddScreenAudit_Success() { //Act var workflowHeader = new WorkflowHeaderModel() { RecordHeaderID = 1002, ContactID = 2, FirstName = "kishantest", LastName = "moothatest", WorkflowDataKey = "Registration-Registration-Demographics_test", }; var addWorkflowHeaderResult = workFlowHeaderController.AddWorkflowHeader(workflowHeader); var response = addWorkflowHeaderResult as HttpResult <Response <WorkflowHeaderModel> >; //Assert Assert.IsNotNull(response, "Response can't be null"); Assert.IsNotNull(response.Value, "Response value can't be null"); Assert.IsNotNull(response.Value.DataItems, "Response value can't be null"); Assert.IsTrue(response.Value.DataItems.Count == 2, "Screen audit details are not added."); }
public void AddSreenAudit_Success() { //Arrange const string url = baseRoute + "AddScreenAudit"; //Act var addWorkflowHeader = new WorkflowHeaderModel() { RecordHeaderID = 1002, ContactID = 2, FirstName = "kishantest", LastName = "moothatest", WorkflowDataKey = "CrisisLine-CrisisLine-CrisisLine", }; //Act var response = _communicationManager.Post <WorkflowHeaderModel, Response <WorkflowHeaderModel> >(addWorkflowHeader, url); // Assert Assert.IsNotNull(response, "Response can not be null"); Assert.IsTrue(response.RowAffected > 0, "client Audit could not be created."); }
public IHttpActionResult AddWorkflowHeader(WorkflowHeaderModel workflowHeader) { return(new HttpResult <Response <WorkflowHeaderModel> >(workflowHeaderDataProvider.AddWorkflowHeader(workflowHeader), Request)); }
public Response <WorkflowHeaderModel> AddWorkflowHeader(WorkflowHeaderModel workflowHeaderModel) { return(workFlowHeaderService.AddWorkflowHeader(workflowHeaderModel)); }
public IHttpActionResult AddWorkflowHeader(WorkflowHeaderModel workflowHeader) { return(new HttpResult <Response <WorkflowHeaderModel> >(workflowHeaderRuleEngine.AddWorkflowHeader(workflowHeader), Request)); }
public Response <WorkflowHeaderModel> AddWorkflowHeader(WorkflowHeaderModel workflowHeader) { return(workflowHeaderRepository.AddWorkflowHeader(workflowHeader)); }
public Response <WorkflowHeaderModel> AddWorkflowHeader(WorkflowHeaderModel workflowHeader) { var apiUrl = baseRoute + "AddWorkflowHeader"; return(communicationManager.Post <WorkflowHeaderModel, Response <WorkflowHeaderModel> >(workflowHeader, apiUrl)); }