Beispiel #1
0
 public TestRunner(TestRunnerOptions options)
 {
     _options                = options;
     userStartIndex          = options.UserNumberToStart;
     userEndIndex            = options.UserNumberToStart + options.UsersCountToTest;
     _userAccountIdentifiers = new string[userEndIndex + 1];
 }
Beispiel #2
0
        public TestRunner(TestRunnerOptions options)
        {
            _options                = options;
            _processingStartTime    = DateTime.Now;
            _processingEndTime      = DateTime.Now.AddMinutes(options.RuntimeInMinutes);
            _userAccountIdentifiers = new string[options.NumberOfUsersToTest + _options.StartUserIndex];

            // Configuring the HTTP client to trust the self-signed certificate
            var httpClientHandler = new HttpClientHandler();

            httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;

            _httpClient             = new HttpClient(httpClientHandler);
            _httpClient.BaseAddress = new Uri(options.TestServiceBaseUri);
        }
Beispiel #3
0
        static async Task Main(string[] args)
        {
            Console.WriteLine("Test run start. Press Esc to stop.");
            try
            {
                IConfiguration configuration = new ConfigurationBuilder()
                                               .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
                                               .Build();
                var options = new TestRunnerOptions();
                configuration.Bind("TestRunner", options);

                await new TestRunner(options).Run();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.WriteLine("Test run completed. Press any key to exit.");
            Console.ReadKey();
        }