protected BaseTests(ITestOutputHelper output)
            {
                var testData = AuthTestData.LoadFromJsonFile();
                var log      = new TestLog(output);

                RequestFactory = new OpenIdRequestFactory(testData);
                OpenIdClient   = OpenIdClientFactory.CreateTestClient(testData.OpenIdServer, log);
            }
            protected private IAuthenticator CreateAuthenticator(Func <OpenIdAuthenticatorBuilder.SpecifyAuthStrategy, AuthTestData, OpenIdAuthenticatorBuilder.Configured> strategyFactory)
            {
                var testData = AuthTestData.LoadFromJsonFile();

                return(new OpenIdAuthenticatorBuilder(new WinApiCrypt(), log)
                       .WithHttpConfiguration(new TestingHttpClientConfiguration(testData.OpenIdServer))
                       .WithClientIdentification(testData.ClientId, testData.ApiKey)
                       .WithAuthenticationStrategy(x => strategyFactory(x, testData))
                       .SubstituteStopwatch(stopwatchMock.StopwatchFactory)
                       .Build());
            }
        public IsolatedAccountEnvironment(IMessageSink messageSink)
        {
            authTestData = AuthTestData.LoadFromJsonFile();
            IResponseCache responseCache = authTestData.TestDataGenerateLevel switch
            {
                TestDataGenerationLevel.TestRun => new EmptyCache(),
                TestDataGenerationLevel.TempFolder => JsonFileResponseCache.InTempFolder(),
                TestDataGenerationLevel.CurrentDirectory => JsonFileResponseCache.InCurrentFolder(),
                _ => throw new ArgumentOutOfRangeException(nameof(authTestData.TestDataGenerateLevel), authTestData.TestDataGenerateLevel, null)
            };
            var log = new TestLog(messageSink);

            lifetime       = new Lifetime(log);
            externTestTool = new ExternTestTool(authTestData.ApiKey, responseCache, lifetime, log);
        }