public void Can_save_workflow_to_database() { // Arrange PayraiseWorkflow workflow = new PayraiseWorkflow { Employee = "Bob Dole", RequestedSalaryAmount = 30000 }; WorkflowStep step1 = new WorkflowStep { Title = "Request for payraise: " + workflow.Employee, AssignedTo = AssignToUser }; WorkflowStep step2 = new WorkflowStep { Title = "Request for payraise: " + workflow.Employee, AssignedTo = AssignToUser }; WorkflowStep step3 = new WorkflowStep { Title = "Request for payraise: " + workflow.Employee, AssignedTo = AssignToUser }; workflow.AddStep(step1); workflow.AddStep(step2); workflow.AddStep(step3); // Act // Adding a workflow saves it to the database. _workflowService.AddWorkflow(workflow); }
public void The_same_workflow_cannot_be_added_twice() { // Arrange TestWorkflow workflow = new TestWorkflow(); TestWorkflowStep step1 = new TestWorkflowStep { Title = "step1", AssignedTo = "Someone1" }; workflow.AddStep(step1); // Act _workflowService.AddWorkflow(workflow); _workflowService.AddWorkflow(workflow); }