Пример #1
0
        public void SummaryCommandServiceBase_UpdateSummary()
        {
            CreateArrestSummary();
            var summaryQueryService = GetDependency <ISummaryQueryService>();

            Assert.IsInstanceOfType(summaryQueryService, typeof(ISummaryQueryService));
            SummaryInfo arrestSummaryInfo = summaryQueryService.GetSummaryInfo(summaryGuid);

            Assert.IsNotNull(arrestSummaryInfo);

            var arrestSummary = MockObjects.NewArrestSummary;

            arrestSummary.Id     = arrestSummaryInfo.Id;
            arrestSummary.Status = new CodeValue("Updated Code", "Updated Description");

            var summariesUnitOfWork = GetDependency <ISummariesUnitOfWork>();

            Assert.IsInstanceOfType(summariesUnitOfWork, typeof(ISummariesUnitOfWork));
            var masterIndexService = GetDependency <IMasterIndexService>();

            Assert.IsInstanceOfType(masterIndexService, typeof(IMasterIndexService));
            var arrestSummaryCommandService = new ArrestSummaryCommandService(
                summariesUnitOfWork,
                masterIndexService,
                Mock.Of <ILog>());

            arrestSummaryCommandService.UpdateSummary(arrestSummary);

            SummaryInfo summary = summaryQueryService.GetSummaryInfo(summaryGuid);

            Assert.IsNotNull(summary);
        }
 public void UpdateSummary()
 {
     _arrestSummaryCommandService.UpdateSummary(new ArrestSummaryDetails());
     _summariesUnitOfWork.Verify(mock => mock.Find <ArrestSummary>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()), Times.Once);
     _summariesUnitOfWork.Verify(mock => mock.Commit(ConcurrencyMode.Throw), Times.Once);
 }