Beispiel #1
0
        public void ServiceDeliveryOrganisationTypeRefDataService_GetAll_CallsRepositoryAll()
        {
            #region Arrange

            #endregion

            #region Act

            _serviceDeliveryOrganisationRefDataService.All();

            #endregion

            #region Assert

            _serviceDeliveryOrganisationTypeRefDataRepository.Verify(x => x.All(), Times.Once);

            #endregion
        }
        private void TransformResolver(ServiceComponent serviceComponent, TemplateRow templateRow)
        {
            if (!ServiceDeliveryOrganisationNames.Descriptions.Contains(templateRow.ServiceDeliveryOrganisation))
            {
                throw new DataImportException($"Error reading Service Decomposition Design spreadsheet. Invalid Responsible Organisation Value - {templateRow.ServiceDeliveryOrganisation}.");
            }

            var dateTimeNow = DateTime.Now;
            var resolver    = new Resolver
            {
                ServiceDesk      = serviceComponent.ServiceFunction.ServiceDomain.ServiceDesk,
                ServiceComponent = serviceComponent,
                ServiceDeliveryOrganisationType = _serviceDeliveryOrganisationTypeRefDataService.All().Single(x => x.ServiceDeliveryOrganisationTypeName == templateRow.ServiceDeliveryOrganisation),
                ServiceDeliveryUnitType         = !string.IsNullOrEmpty(templateRow.ServiceDeliveryUnit) ? _serviceDeliveryUnitTypeRefDataService.InsertorUpdate(templateRow.ServiceDeliveryUnit) : null,
                ResolverGroupType = !string.IsNullOrEmpty(templateRow.ResolverGroup) ? _resolverGroupTypeRefDataService.InsertorUpdate(templateRow.ResolverGroup) : null,
                InsertedBy        = _userIdentity.Name,
                InsertedDate      = dateTimeNow,
                UpdatedBy         = _userIdentity.Name,
                UpdatedDate       = dateTimeNow
            };

            serviceComponent.Resolver = resolver;
            _serviceComponentService.Update(serviceComponent);
        }