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(); }
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(); }
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(); }
// Constructor public HaloApi(Entities dbContext) { _client = _SetUpHaloClient(); _dbContext = dbContext; }