예제 #1
0
        public void TestInitilize()
        {
            _unitOfWork = new Mock <IUnitOfWork>();

            _serviceDeliveryOrganisationTypeRefDatas = new List <ServiceDeliveryOrganisationTypeRefData>
            {
                new ServiceDeliveryOrganisationTypeRefData {
                    Id = 1, ServiceDeliveryOrganisationTypeName = "ServiceDeliveryOrganisation A", SortOrder = 5
                },
                new ServiceDeliveryOrganisationTypeRefData {
                    Id = 2, ServiceDeliveryOrganisationTypeName = "ServiceDeliveryOrganisation B", SortOrder = 5
                },
                new ServiceDeliveryOrganisationTypeRefData {
                    Id = 3, ServiceDeliveryOrganisationTypeName = "ServiceDeliveryOrganisation C", SortOrder = 5
                },
                new ServiceDeliveryOrganisationTypeRefData {
                    Id = 4, ServiceDeliveryOrganisationTypeName = "ServiceDeliveryOrganisation D", SortOrder = 5
                },
            };

            _resolvers = new List <Resolver>
            {
                UnitTestHelper.GenerateRandomData <Resolver>(),
                UnitTestHelper.GenerateRandomData <Resolver>(x =>
                {
                    x.ServiceDeliveryOrganisationType = UnitTestHelper
                                                        .GenerateRandomData <ServiceDeliveryOrganisationTypeRefData>(
                        y =>
                    {
                        y.Id = ServiceDeliveryOrganisationTypeIdInUse;
                        y.ServiceDeliveryOrganisationTypeName = "XYZ";
                    });
                }),
                UnitTestHelper.GenerateRandomData <Resolver>(),
                UnitTestHelper.GenerateRandomData <Resolver>(),
                UnitTestHelper.GenerateRandomData <Resolver>()
            };

            _serviceDeliveryOrganisationTypeRefDataRepository = MockRepositoryHelper.Create(_serviceDeliveryOrganisationTypeRefDatas, (entity, id) => entity.Id == (int)id);

            _resolverRepository = MockRepositoryHelper.Create(_resolvers, (entity, id) => entity.Id == (int)id);

            _serviceDeliveryOrganisationRefDataService = new ServiceDeliveryOrganisationTypeRefDataService(_serviceDeliveryOrganisationTypeRefDataRepository.Object,
                                                                                                           _resolverRepository.Object,
                                                                                                           _unitOfWork.Object);

            Bootstrapper.SetupAutoMapper();
        }
 protected BaseServiceComponentController(IContextManager contextManager,
                                          IServiceComponentService serviceComponentService,
                                          IServiceFunctionService serviceFunctionService,
                                          IServiceDeliveryOrganisationTypeRefDataService serviceDeliveryOrganisationTypeRefDataService,
                                          IServiceDeliveryUnitTypeRefDataService serviceDeliveryUnitTypeRefDataService,
                                          IResolverGroupTypeRefDataService resolverGroupTypeRefDataService,
                                          IParameterService parameterService,
                                          IAppUserContext appUserContext,
                                          IServiceComponentHelper serviceComponentHelper)
     : base(contextManager)
 {
     _contextManager          = contextManager;
     _serviceComponentService = serviceComponentService;
     _serviceFunctionService  = serviceFunctionService;
     _serviceDeliveryOrganisationTypeRefDataService = serviceDeliveryOrganisationTypeRefDataService;
     _serviceDeliveryUnitTypeRefDataService         = serviceDeliveryUnitTypeRefDataService;
     _resolverGroupTypeRefDataService = resolverGroupTypeRefDataService;
     _parameterService       = parameterService;
     _appUserContext         = appUserContext;
     _serviceComponentHelper = serviceComponentHelper;
 }
        public TransformTemplateToDesign(IServiceDeskService serviceDeskService,
                                         IServiceDomainService serviceDomainService,
                                         IServiceFunctionService serviceFunctionService,
                                         IServiceComponentService serviceComponentService,
                                         IDomainTypeRefDataService domainTypeRefDataService,
                                         IFunctionTypeRefDataService functionTypeRefDataService,
                                         IServiceDeliveryOrganisationTypeRefDataService serviceDeliveryOrganisationTypeRefDataService,
                                         IServiceDeliveryUnitTypeRefDataService serviceDeliveryUnitTypeRefDataService,
                                         IResolverGroupTypeRefDataService resolverGroupTypeRefDataService,
                                         IUserIdentity userIdentity)
        {
            if (serviceDeskService == null)
            {
                throw new ArgumentNullException(nameof(serviceDeskService));
            }
            if (serviceDomainService == null)
            {
                throw new ArgumentNullException(nameof(serviceDomainService));
            }
            if (serviceFunctionService == null)
            {
                throw new ArgumentNullException(nameof(serviceFunctionService));
            }
            if (serviceComponentService == null)
            {
                throw new ArgumentNullException(nameof(serviceComponentService));
            }
            if (domainTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(domainTypeRefDataService));
            }
            if (functionTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(functionTypeRefDataService));
            }
            if (serviceDeliveryOrganisationTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(serviceDeliveryOrganisationTypeRefDataService));
            }
            if (serviceDeliveryUnitTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(serviceDeliveryUnitTypeRefDataService));
            }
            if (resolverGroupTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(resolverGroupTypeRefDataService));
            }
            if (userIdentity == null)
            {
                throw new ArgumentNullException(nameof(userIdentity));
            }

            _serviceDeskService         = serviceDeskService;
            _serviceDomainService       = serviceDomainService;
            _serviceFunctionService     = serviceFunctionService;
            _serviceComponentService    = serviceComponentService;
            _domainTypeRefDataService   = domainTypeRefDataService;
            _functionTypeRefDataService = functionTypeRefDataService;
            _serviceDeliveryOrganisationTypeRefDataService = serviceDeliveryOrganisationTypeRefDataService;
            _serviceDeliveryUnitTypeRefDataService         = serviceDeliveryUnitTypeRefDataService;
            _resolverGroupTypeRefDataService = resolverGroupTypeRefDataService;
            _userIdentity = userIdentity;
        }
예제 #4
0
        public ServiceComponentController(IContextManager contextManager,
                                          IAppUserContext appUserContext,
                                          IServiceComponentService serviceComponentService,
                                          IServiceFunctionService serviceFunctionService,
                                          IServiceDeliveryOrganisationTypeRefDataService serviceDeliveryOrganisationTypeRefDataService,
                                          IServiceDeliveryUnitTypeRefDataService serviceDeliveryUnitTypeRefDataService,
                                          IResolverGroupTypeRefDataService resolverGroupTypeRefDataService,
                                          IParameterService parameterService,
                                          IServiceComponentHelper serviceComponentHelper) : base(contextManager,
                                                                                                 serviceComponentService,
                                                                                                 serviceFunctionService,
                                                                                                 serviceDeliveryOrganisationTypeRefDataService,
                                                                                                 serviceDeliveryUnitTypeRefDataService,
                                                                                                 resolverGroupTypeRefDataService,
                                                                                                 parameterService,
                                                                                                 appUserContext,
                                                                                                 serviceComponentHelper)
        {
            if (contextManager == null)
            {
                throw new ArgumentNullException(nameof(contextManager));
            }

            if (appUserContext == null)
            {
                throw new ArgumentNullException(nameof(appUserContext));
            }

            if (serviceComponentService == null)
            {
                throw new ArgumentNullException(nameof(serviceComponentService));
            }

            if (serviceFunctionService == null)
            {
                throw new ArgumentNullException(nameof(serviceFunctionService));
            }

            if (serviceDeliveryOrganisationTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(serviceDeliveryOrganisationTypeRefDataService));
            }

            if (serviceDeliveryUnitTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(serviceDeliveryUnitTypeRefDataService));
            }

            if (resolverGroupTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(resolverGroupTypeRefDataService));
            }

            if (parameterService == null)
            {
                throw new ArgumentNullException(nameof(parameterService));
            }

            if (serviceComponentHelper == null)
            {
                throw new ArgumentNullException(nameof(serviceComponentHelper));
            }

            _contextManager          = contextManager;
            _appUserContext          = appUserContext;
            _serviceComponentService = serviceComponentService;
            _serviceFunctionService  = serviceFunctionService;
            _serviceDeliveryOrganisationTypeRefDataService = serviceDeliveryOrganisationTypeRefDataService;
            _serviceDeliveryUnitTypeRefDataService         = serviceDeliveryUnitTypeRefDataService;
            _resolverGroupTypeRefDataService = resolverGroupTypeRefDataService;
            _parameterService       = parameterService;
            _serviceComponentHelper = serviceComponentHelper;
        }