This commit is contained in:
@@ -1521,9 +1521,9 @@ same as the server does but in a central location here for all tests to use.
|
|||||||
//At the server it assumes nothing
|
//At the server it assumes nothing
|
||||||
//Fix? Possibly this code here in the unit tests needs to adjust the times the same way based on the user account
|
//Fix? Possibly this code here in the unit tests needs to adjust the times the same way based on the user account
|
||||||
|
|
||||||
var vv = Util.MyTest;
|
|
||||||
|
|
||||||
var WidgetNameStart = "DateTokenNextMonthFilterWorks";
|
var WidgetNameStart = "DateTokenNextMonthFilterWorks";
|
||||||
|
var RelativeToday=Util.RelativeToday();
|
||||||
|
|
||||||
long IncludedWidgetId = 0;
|
long IncludedWidgetId = 0;
|
||||||
long ExcludedWidgetId = 0;
|
long ExcludedWidgetId = 0;
|
||||||
@@ -1538,14 +1538,10 @@ same as the server does but in a central location here for all tests to use.
|
|||||||
//Put it right at midnight next month to ensure boundaries are respected
|
//Put it right at midnight next month to ensure boundaries are respected
|
||||||
|
|
||||||
//Note: this test is failing in December 2019, possibly due to year boundary?
|
//Note: this test is failing in December 2019, possibly due to year boundary?
|
||||||
|
|
||||||
|
|
||||||
//Note, due to daylight saving time this test can fail by one hour on the boundary
|
//Note, due to daylight saving time this test can fail by one hour on the boundary
|
||||||
//as noted in March 2019
|
|
||||||
//w.startDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1, 00, 00, 00).AddMonths(1).ToUniversalTime();
|
w.startDate = new DateTime(RelativeToday.Year, RelativeToday.Month, 2, 00, 00, 00).AddMonths(1);
|
||||||
//So changing it to the second to avoid this shit
|
w.endDate = new DateTime(RelativeToday.Year, RelativeToday.Month, 2, 00, 00, 00).AddMonths(1).AddHours(1);
|
||||||
w.startDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 2, 00, 00, 00).AddMonths(1).ToUniversalTime();
|
|
||||||
w.endDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 2, 00, 00, 00).AddMonths(1).AddHours(1).ToUniversalTime();
|
|
||||||
|
|
||||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
@@ -1554,8 +1550,8 @@ same as the server does but in a central location here for all tests to use.
|
|||||||
//Excluded widget (Date range is within NEXT month from one second **before** the 1st to one hour later)
|
//Excluded widget (Date range is within NEXT month from one second **before** the 1st to one hour later)
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
w.name = Util.Uniquify(WidgetNameStart);
|
||||||
//First day of next month minus 1 second
|
//First day of next month minus 1 second
|
||||||
w.startDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1, 00, 00, 00).AddMonths(1).AddSeconds(-1).ToUniversalTime();
|
w.startDate = new DateTime(RelativeToday.Year, RelativeToday.Month, 1, 00, 00, 00).AddMonths(1).AddSeconds(-1);
|
||||||
w.endDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1, 00, 00, 00).AddMonths(1).AddSeconds(-1).AddHours(1).ToUniversalTime();
|
w.endDate = new DateTime(RelativeToday.Year, RelativeToday.Month, 1, 00, 00, 00).AddMonths(1).AddSeconds(-1).AddHours(1);
|
||||||
|
|
||||||
|
|
||||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||||
|
|||||||
18
util.cs
18
util.cs
@@ -11,7 +11,7 @@ namespace raven_integration
|
|||||||
public static class Util
|
public static class Util
|
||||||
{
|
{
|
||||||
//#######################################################################################################
|
//#######################################################################################################
|
||||||
public static string API_BASE_URL = "http://localhost:7575/api/v8/";
|
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 API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
|
||||||
public static string TEST_DATA_FOLDER = @"..\..\..\testdata\";
|
public static string TEST_DATA_FOLDER = @"..\..\..\testdata\";
|
||||||
|
|
||||||
@@ -35,12 +35,26 @@ namespace raven_integration
|
|||||||
|
|
||||||
private static HttpClient client { get; } = new HttpClient();
|
private static HttpClient client { get; } = new HttpClient();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static ConcurrentDictionary<string, string> authDict = new ConcurrentDictionary<string, string>();//10,32
|
public static ConcurrentDictionary<string, string> authDict = new ConcurrentDictionary<string, string>();//10,32
|
||||||
|
|
||||||
private static AutoId Auto { get; } = new AutoId(0);
|
private static AutoId Auto { get; } = new AutoId(0);
|
||||||
|
|
||||||
|
//DateTime stuff
|
||||||
|
|
||||||
|
public static DateTime RelativeToday()
|
||||||
|
{
|
||||||
|
Double TimeZoneAdjustment = ((double)TIME_ZONE_ADJUSTMENT) * -1;
|
||||||
|
return DateTime.Today.AddHours(TimeZoneAdjustment);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DateTime RelativeNow()
|
||||||
|
{
|
||||||
|
Double TimeZoneAdjustment = ((double)TIME_ZONE_ADJUSTMENT) * -1;
|
||||||
|
return DateTime.Now.AddHours(TimeZoneAdjustment);
|
||||||
|
}
|
||||||
|
|
||||||
public static string Uniquify(string s)
|
public static string Uniquify(string s)
|
||||||
{
|
{
|
||||||
// return s + " " + Auto.GetNext().ToString();
|
// return s + " " + Auto.GetNext().ToString();
|
||||||
|
|||||||
Reference in New Issue
Block a user