private void SetUpReport() { _report = new ReportDerived(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid(), Guid.NewGuid(), ModuleType.Arrest, false); _workflowInstance = new WorkflowInstanceDerived(_report, Guid.NewGuid(), null); _reportsUnitOfWork.Setup( mock => mock.FindAndInclude <Report>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>(), include => include.WorkflowInstance)) .Returns(_report); var reportList = new List <Report>(); reportList.Add(_report); _reportsUnitOfWork.Setup(mock => mock.GetEntityQuery <Report>(It.IsAny <TrackingMode>())).Returns(reportList.AsQueryable()); }
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); }
public void WorkflowInstanceLog() { var identityId = Guid.NewGuid(); var _report = new ReportDerived(ReportUnitTestFixture.IdentityId, Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), ModuleType.Arrest, true); workflowInstance = new WorkflowInstanceDerived(_report, Guid.NewGuid(), "data"); workflowInstance.Sequence = 1; workflowInstance.ReportState = ReportState.Approved; workflowInstanceLogObj = new WorkflowInstanceLog(workflowInstance, identityId); workflowInstanceLogObj.Sequence.Should().Be(1); workflowInstanceLogObj.ReportState.Should().Be(ReportState.Approved); workflowInstanceLogObj.Recorded.Should().BeOnOrBefore(DateTime.Now); workflowInstanceLogObj.IdentityId.Should().Be(identityId); }
public void Process_1() { _reportsUoW = new Mock <IReportsUnitOfWork>(); var reportList = new List <Report>(); var sequenceNotationProcessorObj = new SequenceNotationProcessor(_reportsUoW.Object); _report = new ReportDerived(ReportUnitTestFixture.IdentityId, Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), ModuleType.Arrest, false); var WorkflowInstance = new WorkflowInstanceDerived(_report, Guid.NewGuid(), "abc"); _report.WorkflowInstance.ReportState = ReportState.Approved; reportList.Add(_report); sequenceNotationProcessorObj.Process(_report); _report.SequenceNotation.Should().Be(".0"); }
public void RenderReport() { _cache = new Mock <ICacheProvider>(); Cache.SetInstance(_cache.Object); _log = new Mock <ILog>(); _log.Setup(mock => mock.Debug(It.IsAny <string>())); var _report = new ReportDerived(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), ModuleType.Incident, true); _report.Number = "123"; var workflowInstance = new WorkflowInstanceDerived(_report, Guid.NewGuid(), "data"); _documentService = new DocumentService(); _documentService.RenderReport(_report, AttachmentType.PDF, It.IsAny <string>()); _log.VerifyAll(); }
public void Process() { _reportsUoW = new Mock <IReportsUnitOfWork>(); var reportList = new List <Report>(); var sequenceNotationProcessorObj = new SequenceNotationProcessor(_reportsUoW.Object); _report = new ReportDerived(ReportUnitTestFixture.IdentityId, Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), ModuleType.Arrest, true); var WorkflowInstance = new WorkflowInstanceDerived(_report, Guid.NewGuid(), "abc"); _report.Number = "123"; _report.WorkflowInstance.ReportState = ReportState.Approved; reportList.Add(_report); _reportsUoW.Setup(mock => mock.GetEntityQuery <Report>(TrackingMode.Automatic)).Returns(reportList.AsQueryable); sequenceNotationProcessorObj.Process(_report); _report.SequenceNotation.Should().Be(".001"); }
public void SetUp() { var _report = new ReportDerived(ReportUnitTestFixture.IdentityId, Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), ModuleType.Arrest, true); workflowInstance = new WorkflowInstanceDerived(_report, Guid.NewGuid(), "data"); }