Пример #1
0
        public void Assign_Workflows_Continues_On_Exception()
        {
            Service.SetupSequence(s => s.Execute(It.IsAny <AssignRequest>()))
            .Throws(new Exception())
            .Returns(new AssignResponse());

            Workflows.AssignWorkflowsToUser(WorkflowCollection, Guid.NewGuid());

            Service.Verify(s => s.Execute(It.IsAny <AssignRequest>()), Times.Exactly(2));
        }
Пример #2
0
        public void Assigns_To_Given_UserId()
        {
            var userId        = Guid.NewGuid();
            var assignRequest = new AssignRequest();

            Service.Setup(s => s.Execute(It.IsAny <AssignRequest>()))
            .Returns(new AssignResponse())
            .Callback <AssignRequest>(a => assignRequest = a);

            Workflows.AssignWorkflowsToUser(WorkflowCollection, userId);

            Assert.AreEqual(userId, assignRequest.Assignee.Id);
        }
Пример #3
0
 public void Assign_Workflows_Throws_If_UserId_IsEmpty()
 {
     Workflows.AssignWorkflowsToUser(WorkflowCollection, Guid.Empty);
 }
Пример #4
0
        public void Assign_Workflows_Executes_AssignRequest()
        {
            Workflows.AssignWorkflowsToUser(WorkflowCollection, Guid.NewGuid());

            Service.Verify(s => s.Execute(It.IsAny <AssignRequest>()), Times.Exactly(2));
        }
Пример #5
0
 public void Assign_Workflows_Throws_If_WorkflowCollection_IsNull()
 {
     Workflows.AssignWorkflowsToUser(null, Guid.NewGuid());
 }