Esempio n. 1
0
        public void Receive_CheckNotificationQueuesLog()
        {
            _log.Setup(mock => mock.Info(It.IsAny <string>()));
            var workflowNotificationMessage = new WorkflowNotificationMessage(Guid.NewGuid(), null, null, "", NotificationType.Queue);

            //_workflowNotificationService.MessageHandler(workflowNotificationMessage);
            _log.VerifyAll();
        }
Esempio n. 2
0
 public void WorkflowNotificationMessage_InitializingWorkflowNotificationWithNull()
 {
     _workflowNotificationMessage = new WorkflowNotificationMessage(_workflowInstanceId, null, null, null, NotificationType.Queue);
     Assert.AreEqual(_workflowInstanceId, _workflowNotificationMessage.WorkflowInstanceId);
     Assert.IsNull(_workflowNotificationMessage.Users);
     Assert.IsNull(_workflowNotificationMessage.Roles);
     Assert.IsNull(_workflowNotificationMessage.Message);
     Assert.AreEqual(NotificationType.Queue, _workflowNotificationMessage.NotificationType);
 }
Esempio n. 3
0
 public void WorkflowNotificationMessage_InitializingWorkflowNotificationForQueue()
 {
     _workflowNotificationMessage = new WorkflowNotificationMessage(_workflowInstanceId, _users, _roles, Message, NotificationType.Queue);
     Assert.AreEqual(_workflowInstanceId, _workflowNotificationMessage.WorkflowInstanceId);
     Assert.AreEqual(_users, _workflowNotificationMessage.Users);
     Assert.AreEqual(_roles, _workflowNotificationMessage.Roles);
     Assert.AreEqual(Message, _workflowNotificationMessage.Message);
     Assert.AreEqual(NotificationType.Queue, _workflowNotificationMessage.NotificationType);
 }
 public void WorkflowNotificationMessage_InitializingWorkflowNotificationForQueue()
 {
     workflowNotificationMessage = new WorkflowNotificationMessage(workflowInstanceId, users, roles, message, NotificationType.Queue);
     Assert.AreEqual(workflowInstanceId, workflowNotificationMessage.WorkflowInstanceId);
     Assert.AreEqual(users, workflowNotificationMessage.Users);
     Assert.AreEqual(roles, workflowNotificationMessage.Roles);
     Assert.AreEqual(message, workflowNotificationMessage.Message);
     Assert.AreEqual(NotificationType.Queue, workflowNotificationMessage.NotificationType);
 }
Esempio n. 5
0
        public void MessageHandler()
        {
            SetUpAgencyConfiguration();
            _report = new ReportDerived(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid(), Guid.NewGuid(), ModuleType.Arrest, false);
            var workflowInstance = new WorkflowInstanceDerived(_report, Guid.NewGuid(), It.IsAny <string>());

            _reportsUnitOfWork.Setup(mock => mock.Find <WorkflowInstance>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(workflowInstance);
            SetUpAttachment();
            var users = new[] { _userId };
            var workflowNotificationMessage = new WorkflowNotificationMessage(Guid.NewGuid(), users, null, "", NotificationType.Attachment);
            //_workflowNotificationService.MessageHandler(workflowNotificationMessage);
        }
Esempio n. 6
0
        private void PublishWorkflowNotificationMessage(WorkflowInstance instance)
        {
            // Create the Message
            var message = new WorkflowNotificationMessage(instance.Id, UserIds, RoleIds, EmailMessage, NotificationType);

            // Publish the message
            // MessageBus.Publish(message);

            using (var client = DependencyContainer.Resolve <IMessageBusPublishClient>())
            {
                client.Instance.Publish(message);
            }
        }