Example #1
0
        internal TestRailApiClient(TestRailApiClientConfiguration config, IWebClientFactory webClientFactory = null)
        {
            _config           = config;
            _webClientFactory = webClientFactory ?? new WebClientFactory();

            if (string.IsNullOrEmpty(config.Url))
            {
                throw new TestRailClientException("Url is not provided in TestRail client configuration.");
            }

            if (string.IsNullOrEmpty(config.UserName))
            {
                throw new TestRailClientException("UserName is not provided in TestRail client configuration.");
            }

            if (string.IsNullOrEmpty(config.AppKey))
            {
                throw new TestRailClientException("AppKey is not provided in TestRail client configuration.");
            }

            if (config.Url.Last() != '/')
            {
                config.Url += "/";
            }

            _statuses = new Lazy <TestRailStatusDictionary>(
                () => InnerGetStatusesAsync().Result);
            _priorities = new Lazy <TestRailPriorityDictionary>(
                () => InnerGetPrioritiesAsync().Result);
        }
Example #2
0
 public TestRailApiClient(TestRailApiClientConfiguration config) : this(config, null)
 {
 }