<commit_before>﻿using System;
using System.Collections.Generic;
using Microsoft.Framework.Configuration;

namespace Magento.RestApi.IntegrationTests
{
    public class BaseFixture : IDisposable
    {
        private readonly Dictionary<string, IMagentoApi> magentoApis = new Dictionary<string, IMagentoApi>();
        private readonly object _object = new object();

        public IMagentoApi Client { 
            get { return InitializeClient(); }
        }

        public BaseFixture()
        {
            var configurationBuilder = new ConfigurationBuilder()
                // change to full path to make this work
                .AddJsonFile("config.json");
            var configuration = configurationBuilder.Build();

            Url = configuration.Get("url");
            CustomAdminUrlPart = configuration.Get("adminurlpart");
            ConsumerKey = configuration.Get("consumerkey");
            ConsumerSecret = configuration.Get("consumersecret");
            UserName = configuration.Get("username");
            Password = configuration.Get("password");
        }

        protected string Url { get; set; }
        protected string CustomAdminUrlPart { get; set; }
        protected string ConsumerKey { get; set; }
        protected string ConsumerSecret { get; set; }
        protected string UserName { get; set; }
        protected string Password { get; set; }

        protected IMagentoApi InitializeClient()
        {
            lock (_object)
            {
                var uri = new Uri(Url);
                if (!magentoApis.ContainsKey(uri.Host))
                {<commit_msg>Fixes configuration for latest dnx<commit_after>﻿using System;
using System.Collections.Generic;
using Microsoft.Framework.Configuration;

namespace Magento.RestApi.IntegrationTests
{
    public class BaseFixture : IDisposable
    {
        private readonly Dictionary<string, IMagentoApi> magentoApis = new Dictionary<string, IMagentoApi>();
        private readonly object _object = new object();

        public IMagentoApi Client { 
            get { return InitializeClient(); }
        }

        public BaseFixture()
        {
            var configurationBuilder = new ConfigurationBuilder()
                // change to full path to make this work
                .AddJsonFile("config.json");
            var configuration = configurationBuilder.Build();

            Url = configuration["url"];
            CustomAdminUrlPart = configuration["adminurlpart"];
            ConsumerKey = configuration["consumerkey"];
            ConsumerSecret = configuration["consumersecret"];
            UserName = configuration["username"];
            Password = configuration["password"];
        }

        protected string Url { get; set; }
        protected string CustomAdminUrlPart { get; set; }
        protected string ConsumerKey { get; set; }
        protected string ConsumerSecret { get; set; }
        protected string UserName { get; set; }
        protected string Password { get; set; }

        protected IMagentoApi InitializeClient()
        {
            lock (_object)
            {
                var uri = new Uri(Url);
                if (!magentoApis.ContainsKey(uri.Host))
                {
{'fraction_non_alphanumeric': 0.08604147322810275, 'fraction_numerical': 0.0, 'mean_word_length': 2.2095332671300896, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3009870', 'n_tokens_mistral': 769, 'n_tokens_neox': 726, 'n_words': 210}