public void AddAttachmentToReport()
        {
            var attachment = MockObject.NewDataEntryAttachment;
            var result     = _attachmentCommandService.AddAttachmentToReport(attachment, Guid.NewGuid());

            Assert.IsInstanceOf(typeof(Guid), result);
            _reportDerived.Attachments.Should().HaveCount(1);
            result.Should().Be(attachment.Id);
            _reportDerived.Attachments.Select(item => item.FileName).FirstOrDefault().Should().Be(attachment.FileName);
            _reportsUnitOfWork.Verify(mock => mock.Commit(It.IsAny <ConcurrencyMode>()), Times.Once);
            //_eventDispatcher.Verify( mock => mock.Publish( It.IsAny<object>() ) );
        }
예제 #2
0
 public void AssociateToReport(Guid id, MediaMeta mediaMeta)
 {
     _attachmentCommandService.AddAttachmentToReport(MapAttachment(mediaMeta), id);
 }