C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
EnvironmentSettings.cs
Go to the documentation of this file.
2
4{
7 public static class EnvironmentSettings
8 {
9 #region Public Read-Only Properties
10 #region Server Credentials
12 public static string API_URL { get; private set; }
13
14 #region HTTPS Related Variables
16 public static string HTTPS_USER { get; private set; }
17
19 public static string HTTPS_PASSWORD { get; private set; }
20
22 public static bool VALIDATE_SERVER_CERTIFICATE { get; private set; }
23 #endregion HTTPS Related Variables
24 #endregion Server Credentials
25
26 #region Cleanup Related Variables
29 public static bool ROOT_DELETE_SUPPORTED { get; private set; }
30
32 public static bool RESOURCE_DELETE_SUPPORTED { get; private set; }
33
35 public static bool ENFORCE_CLEANUP_BEFORE_RUN { get; private set; }
36
38 public static bool ENFORCE_CLEANUP_AFTER_RUN { get; private set; }
39 #endregion Cleanup Related Variables
40
41 #region Timeout Related Variables
43 public static int REQUEST_TIMEOUT { get; private set; }
44
46 public static int COLLECTION_REQUEST_TIMEOUT { get; private set; }
47
49 public static int DATA_UPLOAD_TIMEOUT { get; private set; }
50
52 public static int OPTIMIZATION_TIMEOUTS { get; private set; }
53
55 public static int SIMULATION_TIMEOUT { get; private set; }
56
58 public static int DELETE_TIMEOUT { get; private set; }
59
61 public static int POLLING_INTERVAL { get; private set; }
62 #endregion Timeout Related Variables
63
64 #region Skip Related Variables
67 public static bool SKIPS_ENABLED { get; private set; }
68
71 public static bool FAIL_ON_EXPIRED_SKIP { get; private set; }
72
75 public static bool RANDOMIZED_TESTS_ENABLED { get; private set; }
76 #endregion Skip Related Variables
77
79 public static bool ENABLE_REQUEST_DEBUG_LOGGING { get; private set; }
80
83 public static bool EXECUTING_IN_PARALLEL { get; private set; }
84
87 public static bool RUN_OFFLINE { get; private set; }
88 #endregion Public Read-Only Properties
89
90 static EnvironmentSettings()
91 {
92 Reload();
93 }
94
96 public static void Reload()
97 {
98 API_URL = Configuration.EnvVariable("API_URL", Settings.Default.API_URL);
99 HTTPS_USER = Configuration.EnvVariable("HTTPS_USER", Settings.Default.HTTPS_USER);
100 HTTPS_PASSWORD = Configuration.EnvVariable("HTTPS_PASSWORD", Settings.Default.HTTPS_PASSWORD);
101 VALIDATE_SERVER_CERTIFICATE = Configuration.EnvVariable("VALIDATE_SERVER_CERTIFICATE", Settings.Default.VALIDATE_SERVER_CERTIFICATE);
102 ROOT_DELETE_SUPPORTED = Configuration.EnvVariable("ROOT_DELETE_SUPPORTED", Settings.Default.ROOT_DELETE_SUPPORTED);
103 RESOURCE_DELETE_SUPPORTED = Configuration.EnvVariable("RESOURCE_DELETE_SUPPORTED", Settings.Default.RESOURCE_DELETE_SUPPORTED);
104 ENFORCE_CLEANUP_BEFORE_RUN = Configuration.EnvVariable("ENFORCE_CLEANUP_BEFORE_RUN", Settings.Default.ENFORCE_CLEANUP_BEFORE_RUN);
105 ENFORCE_CLEANUP_AFTER_RUN = Configuration.EnvVariable("ENFORCE_CLEANUP_AFTER_RUN", Settings.Default.ENFORCE_CLEANUP_AFTER_RUN);
106 REQUEST_TIMEOUT = Configuration.EnvVariable("REQUEST_TIMEOUT", Settings.Default.REQUEST_TIMEOUT);
107 COLLECTION_REQUEST_TIMEOUT = Configuration.EnvVariable("COLLECTION_REQUEST_TIMEOUT", Settings.Default.COLLECTION_REQUEST_TIMEOUT);
108 DATA_UPLOAD_TIMEOUT = Configuration.EnvVariable("DATA_UPLOAD_TIMEOUT", Settings.Default.DATA_UPLOAD_TIMEOUT);
109 OPTIMIZATION_TIMEOUTS = Configuration.EnvVariable("OPTIMIZATION_TIMEOUTS", Settings.Default.OPTIMIZATION_TIMEOUTS);
110 SIMULATION_TIMEOUT = Configuration.EnvVariable("SIMULATION_TIMEOUT", Settings.Default.SIMULATION_TIMEOUT);
111 DELETE_TIMEOUT = Configuration.EnvVariable("DELETE_TIMEOUT", Settings.Default.DELETE_TIMEOUT);
112 POLLING_INTERVAL = Configuration.EnvVariable("POLLING_INTERVAL", Settings.Default.POLLING_INTERVAL);
113 SKIPS_ENABLED = Configuration.EnvVariable("SKIPS_ENABLED", Settings.Default.SKIPS_ENABLED);
114 FAIL_ON_EXPIRED_SKIP = Configuration.EnvVariable("FAIL_ON_EXPIRED_SKIP", Settings.Default.FAIL_ON_EXPIRED_SKIP);
115 RANDOMIZED_TESTS_ENABLED = Configuration.EnvVariable("RANDOMIZED_TESTS_ENABLED", Settings.Default.RANDOMIZED_TESTS_ENABLED);
116 ENABLE_REQUEST_DEBUG_LOGGING = Configuration.EnvVariable("ENABLE_REQUEST_DEBUG_LOGGING", Settings.Default.ENABLE_REQUEST_DEBUG_LOGGING);
117 EXECUTING_IN_PARALLEL = Configuration.EnvVariable("EXECUTING_IN_PARALLEL", Settings.Default.EXECUTING_IN_PARALLEL);
118 RUN_OFFLINE = Configuration.EnvVariable("RUN_OFFLINE", Settings.Default.RUN_OFFLINE);
119 }
120 }
121}
Retrieve settings from environment variables if they exist, or the project settings file otherwise.
static void Reload()
Read all settings and environment variables again and re-assign all properties.
static int DATA_UPLOAD_TIMEOUT
Amount of time to wait for data upload requests to complete (in milliseconds).
static string API_URL
The URL against which server tests are run.
static bool ENABLE_REQUEST_DEBUG_LOGGING
Controls whenther AnalyzeRe.Client.API.DebugLogging is enabled.
static int COLLECTION_REQUEST_TIMEOUT
Amount of time to wait for requests on collection endpoints to complete (in milliseconds).
static bool ENFORCE_CLEANUP_BEFORE_RUN
Indicates whether the server should be wiped clean before every unit test is run.
static int OPTIMIZATION_TIMEOUTS
Amount of time to wait for optimization engine requests to complete (in milliseconds).
static bool FAIL_ON_EXPIRED_SKIP
If true, expired SkipUntils will raise an exception saying they are expired. If false,...
static bool RUN_OFFLINE
Controls whether tests that normally require a connection to the server should be allowed to try to r...
static int REQUEST_TIMEOUT
Amount of time to wait for requests to complete (in milliseconds).
static int DELETE_TIMEOUT
Amount of time to wait for DELETE to complete (in milliseconds).
static bool ROOT_DELETE_SUPPORTED
Indicates whether the server currently supports the DELETE method on the server root to wipe out all ...
static bool RANDOMIZED_TESTS_ENABLED
If false, tests that involve random generation of resources (which can be unstable) will be skipped.
static int POLLING_INTERVAL
Frequency with which to poll the server for updates during tests (in milliseconds).
static int SIMULATION_TIMEOUT
Amount of time to wait for simulations to complete (in milliseconds).
static bool VALIDATE_SERVER_CERTIFICATE
Indicates whether the SSL/TLS certificate for the HTTPS server should be validated.
static bool SKIPS_ENABLED
If true, SkipUntils can be used to skip tests. If false, SkipUntils will be ignored and all tests wil...
static bool ENFORCE_CLEANUP_AFTER_RUN
Indicates whether the server should be wiped clean after every unit test is run.
static string HTTPS_USER
The username for the HTTPS server authentication.
static string HTTPS_PASSWORD
The password for the HTTPS server authentication.
static bool RESOURCE_DELETE_SUPPORTED
Indicates whether the server currently supports the DELETE method on resources.
static bool EXECUTING_IN_PARALLEL
If true, tests are being run in parallel, so certain assumptions about the state of the server after ...