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

            Assert.IsInstanceOf(typeof(Guid), result);
            result.Should().Be(attachment.Id);
            _summaryDerived.Attachments.Should().HaveCount(1);
            _summaryDerived.Attachments.Select(item => item.Description).FirstOrDefault().Should().Be(attachment.Description);
            _summariesUnitOfWork.Verify(mock => mock.Commit(It.IsAny <ConcurrencyMode>()), Times.Once);

            //_eventDispatcher.Verify( mock => mock.Publish( It.IsAny<object>() ) );
        }
Example #2
0
 public void AssociateToSummary(Guid id, MediaMeta mediaMeta)
 {
     _attachmentCommandService.AddAttachmentToSummary(MapAttachment(mediaMeta), id);
 }