From c4d744d5242e1d2c04623993c6be19a1df549f75 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 10 Dec 2019 23:45:13 +0000 Subject: [PATCH] All tests passing --- DataFilter/DataFilterFilteringLists.cs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/DataFilter/DataFilterFilteringLists.cs b/DataFilter/DataFilterFilteringLists.cs index f85490f..d87a30d 100644 --- a/DataFilter/DataFilterFilteringLists.cs +++ b/DataFilter/DataFilterFilteringLists.cs @@ -1513,17 +1513,10 @@ same as the server does but in a central location here for all tests to use. [Fact] public async void DateTokenNextMonthFilterWorks() { - - //SERVER thinks midnight UTC is 7am our time on January 1st 2020 - //TEST thinks midnight UTC is 8am our time on January 1st 2020 - //THIS is because the User time zone offset is taken into account *at the server* but it isn't here - //Here, it assumes the correct offset was set in the test data - //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 - - + //This test is time zone sensitive and thus uses relative today + //If any other test are to fail this way they will need to be done the same way var WidgetNameStart = "DateTokenNextMonthFilterWorks"; - var RelativeToday=Util.RelativeToday(); + var RelativeToday = Util.RelativeToday(); long IncludedWidgetId = 0; long ExcludedWidgetId = 0; @@ -1535,11 +1528,8 @@ same as the server does but in a central location here for all tests to use. w.name = Util.Uniquify(WidgetNameStart); w.notes = "blah"; w.customFields = Util.WidgetRequiredCustomFieldsJsonString(); + //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 - 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);