Esempio n. 1
0
        protected override void Load(ContainerBuilder builder)
        {
            var subscriptionKey = ConfigurationManager.AppSettings["SubscriptionKey"];

            var product = new Product
            {
                SubscriptionKey = subscriptionKey,
                RateLimit       = new RateLimit
                {
                    RequestCount = 200,
                    TimeSpan     = new TimeSpan(0, 0, 0, 10),
                    Timeout      = new TimeSpan(0, 0, 0, 10)
                }
            };

            var cacheSettings = new CacheSettings
            {
                CacheDuration = new TimeSpan(0, 1, 0, 0)
            };

            var haloClient  = new HaloClient(product, cacheSettings);
            var haloSession = haloClient.StartSession();

            builder.RegisterInstance(haloSession)
            .AsImplementedInterfaces()
            .SingleInstance();
        }
Esempio n. 2
0
        public void RunBeforeAnyTests()
        {
            var developerAccessProduct = new Product
            {
                SubscriptionKey = "00000000000000000000000000000000",
                RateLimit = new RateLimit
                {
                    RequestCount = 10,
                    TimspSpan = new TimeSpan(0, 0, 0, 10),
                    Timeout = new TimeSpan(0, 0, 0, 10)
                }
            };

            var client = new HaloClient(developerAccessProduct);
            Session = client.StartSession();
        }
Esempio n. 3
0
        public void RunBeforeAnyTests()
        {
            var developerAccessProduct = new Product
            {
                SubscriptionKey = "00000000000000000000000000000000",
                RateLimit       = new RateLimit
                {
                    RequestCount = 10,
                    TimspSpan    = new TimeSpan(0, 0, 0, 10),
                    Timeout      = new TimeSpan(0, 0, 0, 10)
                }
            };

            var client = new HaloClient(developerAccessProduct);

            Session = client.StartSession();
        }
Esempio n. 4
0
        public void RunBeforeAnyTests()
        {
            var developerAccessProduct = new Product
            {
                SubscriptionKey = "00000000000000000000000000000000",
                RateLimit = new RateLimit
                {
                    RequestCount = 10,
                    TimeSpan = new TimeSpan(0, 0, 0, 10),
                    Timeout = new TimeSpan(0, 0, 0, 10)
                }
            };

            var cacheSettings = new CacheSettings
            {
                MetadataCacheDuration = new TimeSpan(0, 0, 10, 0),
                ProfileCacheDuration = new TimeSpan(0, 0, 10, 0),
                StatsCacheDuration = null //Don't cache 'Stats' endpoints.
            };

            var client = new HaloClient(developerAccessProduct, cacheSettings);
            Session = client.StartSession();
        }
Esempio n. 5
0
        public void RunBeforeAnyTests()
        {
            var developerAccessProduct = new Product
            {
                SubscriptionKey = "00000000000000000000000000000000",
                RateLimit       = new RateLimit
                {
                    RequestCount = 10,
                    TimeSpan     = new TimeSpan(0, 0, 0, 10),
                    Timeout      = new TimeSpan(0, 0, 0, 10)
                }
            };

            var cacheSettings = new CacheSettings
            {
                MetadataCacheDuration = new TimeSpan(0, 0, 10, 0),
                ProfileCacheDuration  = new TimeSpan(0, 0, 10, 0),
                StatsCacheDuration    = null //Don't cache 'Stats' endpoints.
            };

            var client = new HaloClient(developerAccessProduct, cacheSettings);

            Session = client.StartSession();
        }
Esempio n. 6
0
        // Constructor
        public HaloApi(Entities dbContext)
        {
            _client = _SetUpHaloClient();

            _dbContext = dbContext;
        }