This commit is contained in:
2019-12-10 23:36:55 +00:00
parent 7f3a6a312e
commit ec33613920
2 changed files with 23 additions and 13 deletions

View File

@@ -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
//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 RelativeToday=Util.RelativeToday();
long IncludedWidgetId = 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
//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
//as noted in March 2019
//w.startDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1, 00, 00, 00).AddMonths(1).ToUniversalTime();
//So changing it to the second to avoid this shit
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();
w.startDate = new DateTime(RelativeToday.Year, RelativeToday.Month, 2, 00, 00, 00).AddMonths(1);
w.endDate = new DateTime(RelativeToday.Year, RelativeToday.Month, 2, 00, 00, 00).AddMonths(1).AddHours(1);
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
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)
w.name = Util.Uniquify(WidgetNameStart);
//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.endDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1, 00, 00, 00).AddMonths(1).AddSeconds(-1).AddHours(1).ToUniversalTime();
w.startDate = new DateTime(RelativeToday.Year, RelativeToday.Month, 1, 00, 00, 00).AddMonths(1).AddSeconds(-1);
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());