コード例 #1
0
        public void ClassSetUp()
        {
            _factory = new MockRepository(MockBehavior.Loose);

            _reportsUnitOfWork       = _factory.Create <IReportsUnitOfWork>();
            _summariesUnitOfWork     = _factory.Create <ISummariesUnitOfWork>();
            _classicImagesRepository = _factory.Create <IClassicImagesRepository>();
            _reportDerived           = new ReportDerived(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), ModuleType.Incident, true);
            _case                       = new Domain.Summaries.Case.Case(Guid.NewGuid(), Guid.NewGuid(), "number");
            _summaryDerived             = new SummaryDerived(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), ModuleType.Incident, "number", _case);
            _reportAttachment           = new ReportAttachment(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid());
            _reportAttachment.FileName  = FileName;
            _reportAttachment.Source    = "InformRMSWeb";
            _summaryAttachment          = new SummaryAttachment(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid());
            _summaryAttachment.FileName = FileName;
            _summaryAttachment.Source   = "InformRMSWeb";
            _reportsUnitOfWork.Setup(mock => mock.Find <ReportAttachment>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(_reportAttachment);

            _reportsUnitOfWork.Setup(mock => mock.Find <Report>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(_reportDerived);
            _summariesUnitOfWork.Setup(mock => mock.Find <Summary>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(_summaryDerived);
            _summariesUnitOfWork.Setup(mock => mock.Find <SummaryAttachment>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(_summaryAttachment);
            _attachmentQueryService = new AttachmentQueryService(_reportsUnitOfWork.Object, _summariesUnitOfWork.Object, _classicImagesRepository.Object, Mock.Of <ILog>(),
                                                                 Mock.Of <IServiceAuthorizationPolicy>(), Mock.Of <IServiceIdentityProvider>());
        }
コード例 #2
0
 public AttachmentsController(IMediaMetaService mediaMetaService,
                              IMediaDataService mediaDataService,
                              IAttachmentCommandService attachmentCommandService,
                              IAttachmentQueryService attachmentQueryService)
 {
     _mediaMetaService         = mediaMetaService;
     _mediaDataService         = mediaDataService;
     _attachmentCommandService = attachmentCommandService;
     _attachmentQueryService   = attachmentQueryService;
 }