This commit is contained in:
2019-12-10 20:57:33 +00:00
parent eb3dc7d9c7
commit 7f3a6a312e
3 changed files with 89 additions and 114 deletions

22
util.cs
View File

@@ -10,6 +10,17 @@ namespace raven_integration
{
public static class Util
{
//#######################################################################################################
public static string API_BASE_URL = "http://localhost:7575/api/v8/";
//public static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
public static string TEST_DATA_FOLDER = @"..\..\..\testdata\";
public const decimal TIME_ZONE_ADJUSTMENT = -7;
//#######################################################################################################
public const string OpEquality = "=";
public const string OpGreaterThan = ">";
public const string OpGreaterThanOrEqualTo = ">=";
@@ -24,10 +35,7 @@ namespace raven_integration
private static HttpClient client { get; } = new HttpClient();
public static string API_BASE_URL = "http://localhost:7575/api/v8/";
//public static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
public static string TEST_DATA_FOLDER = @"..\..\..\testdata\";
public static ConcurrentDictionary<string, string> authDict = new ConcurrentDictionary<string, string>();//10,32
@@ -41,8 +49,6 @@ namespace raven_integration
public async static Task<string> GetTokenAsync(string login, string password = null)
{
// Console.WriteLine($"GetTokenAsync:{login}");
//System.Diagnostics.Trace.WriteLine($"GetTokenAsync:{login}");
if (password == null)
password = login;
@@ -141,12 +147,12 @@ namespace raven_integration
public async static Task<ApiTextResponse> GetNonApiPageAsync(string route)
{
init();
var requestMessage = new HttpRequestMessage(HttpMethod.Get, CleanNonApiRoute(route));
var requestMessage = new HttpRequestMessage(HttpMethod.Get, CleanNonApiRoute(route));
HttpResponseMessage response = await client.SendAsync(requestMessage);
var responseAsString = await response.Content.ReadAsStringAsync();
return new ApiTextResponse() { HttpResponse = response, TextResponse = responseAsString };
}