public virtual IBusinessObjectService CreateService(IBusinessObjectProviderWithIdentity provider, Type serviceType)
        {
            ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("serviceType", serviceType, typeof(IBusinessObjectService));

            if (serviceType == typeof(IBusinessObjectStringFormatterService))
            {
                return(new BusinessObjectStringFormatterService());
            }

            return(null);
        }
Esempio n. 2
0
 public void SetUp()
 {
     _serviceFactory = BindableObjectServiceFactory.Create();
     _serviceMixin   = Mixin.Get <SecurityManagerObjectServiceFactoryMixin> (_serviceFactory);
     _mockRepository = new MockRepository();
     _bindableDomainObjectProvider = _mockRepository.Stub <IBusinessObjectProviderWithIdentity>();
     _bindableObjectProvider       = _mockRepository.Stub <IBusinessObjectProviderWithIdentity>();
     SetupResult.For(_bindableDomainObjectProvider.ProviderAttribute).Return(new BindableDomainObjectProviderAttribute());
     SetupResult.For(_bindableObjectProvider.ProviderAttribute).Return(new BindableObjectProviderAttribute());
     _mockRepository.ReplayAll();
 }
Esempio n. 3
0
        public virtual IBusinessObjectService CreateService(IBusinessObjectProviderWithIdentity provider, Type serviceType)
        {
            ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("serviceType", serviceType, typeof(IBusinessObjectService));

            if (serviceType == typeof(SubstitutionPropertiesSearchService))
            {
                return(new SubstitutionPropertiesSearchService());
            }

            if (serviceType == typeof(RolePropertiesSearchService))
            {
                return(new RolePropertiesSearchService());
            }

            if (serviceType == typeof(TenantPropertyTypeSearchService))
            {
                return(new TenantPropertyTypeSearchService());
            }

            if (serviceType == typeof(GroupPropertyTypeSearchService))
            {
                return(new GroupPropertyTypeSearchService());
            }

            if (serviceType == typeof(UserPropertyTypeSearchService))
            {
                return(new UserPropertyTypeSearchService());
            }

            if (serviceType == typeof(PositionPropertyTypeSearchService))
            {
                return(new PositionPropertyTypeSearchService());
            }

            if (serviceType == typeof(GroupTypePropertyTypeSearchService))
            {
                return(new GroupTypePropertyTypeSearchService());
            }

            if (serviceType == typeof(AbstractRoleDefinitionPropertyTypeSearchService))
            {
                return(new AbstractRoleDefinitionPropertyTypeSearchService());
            }

            return(Next.CreateService(provider, serviceType));
        }
Esempio n. 4
0
        public virtual IBusinessObjectService CreateService(IBusinessObjectProviderWithIdentity provider, Type serviceType)
        {
            ArgumentUtility.CheckNotNull("provider", provider);
            ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("serviceType", serviceType, typeof(IBusinessObjectService));

            if (provider.ProviderAttribute is BindableDomainObjectProviderAttribute)
            {
                if (serviceType == typeof(IGetObjectService))
                {
                    return(new BindableDomainObjectGetObjectService());
                }

                if (serviceType == typeof(ISearchAvailableObjectsService))
                {
                    return(new BindableDomainObjectCompoundSearchService());
                }
            }

            return(Next.CreateService(provider, serviceType));
        }
 public void SetUp()
 {
     _serviceFactory = BindableObjectServiceFactory.Create();
     _provider       = MockRepository.GenerateStub <IBusinessObjectProviderWithIdentity>();
 }