コード例 #1
0
        public void SetUp()
        {
            _usageLogic            = GetInst <IUsageLogic>();
            _accessRightLogic      = GetInst <AccessRightLogic>();
            _hateoasHandlerFactory = GetInst <IHateoasHandlerFactory>();
            _userManager           = GetInst <IUserManager>();

            base.Setup();
        }
コード例 #2
0
        protected T CreateTestControllerWith <T>(
            IUserManager userManager = null,
            IUsageLogic usageLogic   = null,
            IHateoasHandlerFactory hateoasHandlerFactory = null,
            AccessRightLogic accessRightLogic            = null
            ) where T : ApiController, new()
        {
            userManager           = useOrDefault <IUserManager>(userManager, _userManager);
            usageLogic            = useOrDefault <IUsageLogic>(usageLogic, _usageLogic);
            hateoasHandlerFactory = useOrDefault <IHateoasHandlerFactory>(hateoasHandlerFactory, _hateoasHandlerFactory);
            accessRightLogic      = useOrDefault <AccessRightLogic>(accessRightLogic, _accessRightLogic);

            return(new UsageController(userManager, usageLogic, hateoasHandlerFactory, accessRightLogic) as T);
        }
コード例 #3
0
        public new void Setup()
        {
            base.Setup();

            _topUpLogic = GetInst <ITopUpLogic>();

            _userManager         = GetInst <IUserManager>();
            _usageLogic          = GetInst <IUsageLogic>();
            _userValidationLogic = GetInst <UserValidationLogic>();

            _accessRightLogic = GetInst <IAccessRightLogic>();

            _subscriptionService       = GetInst <ISubscriptionService>();
            _subscriptionLogic         = GetInst <ISubscriptionLogic>();
            _subscriptionVasLogic      = GetInst <SubscriptionVasLogic>();
            _subscriptionStatusLogic   = GetInst <ISubscriptionStatusLogic>();
            _changeSubscriptionLogic   = GetInst <IChangeSubscriptionLogic>();
            _subscriptionOfferingLogic = GetInst <ISubscriptionOfferingLogic>();

            _appSettings    = GetInst <IApplicationSettings>();
            _catalogService = GetInst <ICatalogService>();

            _cbmService    = GetInst <ICbmService>();
            _orderSimLogic = GetInst <IOrderSimLogic>();
            _accountLogic  = GetInst <IAccountLogic>();

            dict = new Dictionary <Params, object>()
            {
                { Params.TopUp, _topUpLogic },
                { Params.UserManager, _userManager },
                { Params.Usage, _usageLogic },
                { Params.UserValidation, _userValidationLogic },
                { Params.AccessRights, _accessRightLogic },
                { Params.SubscriptionService, _subscriptionService },
                { Params.Subscription, _subscriptionLogic },
                { Params.SubscriptionVas, _subscriptionVasLogic },
                { Params.SubscriptionStatus, _subscriptionStatusLogic },
                { Params.ChangeSubscription, _changeSubscriptionLogic },
                { Params.SubscriptionOffering, _subscriptionOfferingLogic },
                { Params.AppSettings, _appSettings },
                { Params.CatalogService, _catalogService },
                { Params.CbmService, _cbmService },
                { Params.OrderSim, _orderSimLogic },
                { Params.Account, _accountLogic }
            };
        }