public void ClassLevelSetUp()
        {
            var jurisdiction = new Jurisdiction("ori", "agencyCode");

            _agency   = new AgencyDerived(jurisdiction, "name");
            _workflow = _agency.CreateWorkflow("Workflow Title", null);
            _workflowInstanceService = new WorkflowInstanceService();
            SetUpReport();
        }
Exemple #2
0
        public void ClassLevelSetUp()
        {
            var identityContext = new IdentityContext {
                IdentityId = Guid.NewGuid()
            };

            _authorizationPolicy = new Mock <IServiceAuthorizationPolicy>();
            _identityProvider    = new Mock <IServiceIdentityProvider>();
            _identityProvider.Setup(x => x.GetPrincipalIdentifier()).Returns(identityContext.IdentityId);
            _identityProvider.Setup(x => x.GetIdentityContext()).Returns(identityContext);


            _agency = AdministrationUnitTestFixture.AgencyDetails;
            _administrationUnitOfWork = new Mock <IAdministrationUnitOfWork>();
            _workflow = _agency.CreateWorkflow("Workflow Title", null);
            _administrationUnitOfWork.Setup(item => item.Find <Workflow>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>())).Returns(_workflow);
            _workflowCommandService = new WorkflowCommandService(_administrationUnitOfWork.Object, Mock.Of <ILog>(), _authorizationPolicy.Object, _identityProvider.Object);
        }
Exemple #3
0
        public void GetWorkflows()
        {
            var workFlowList = new List <Workflow>();
            var workflow     = _agency.CreateWorkflow("title", "xaml");

            workFlowList.Add(workflow);

            _unitOfWorkAdmin.Setup(item => item.GetEntityQuery <Workflow>(It.IsAny <TrackingMode>()))
            .Returns(workFlowList.AsQueryable());

            var result = _agencyQueryService.GetWorkflows(_agency.Id);

            result.Should().NotBeNullOrEmpty();
            result.Select(item => item.AgencyId).FirstOrDefault().Should().Be(_agency.Id);
            result.Select(item => item.Title).FirstOrDefault().ShouldAllBeEquivalentTo("title");
            result.Select(item => item.Id).FirstOrDefault().Should().Be(workflow.Id);
            result.Select(item => item.Enabled).FirstOrDefault().Should().Be(false);

            workflow.Enable();
            result = _agencyQueryService.GetWorkflows(_agency.Id);
            result.Select(item => item.Enabled).FirstOrDefault().Should().Be(true);
        }
Exemple #4
0
 public void CheckSameWorkflowTitle()
 {
     _agency.CreateWorkflow("New Workflow Title", null);
     _agency.CreateWorkflow("New Workflow Title", null);
 }