Skip to content

Commit

Permalink
Add more test cases for ScheduleUtils.ParseTime (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
karashiiro authored Feb 5, 2024
1 parent b76d1ac commit 7deb729
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Prima.Tests/ScheduleUtilTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,13 @@ public void ParseTime_WorksAsExpectedWithYear(string input, int expectedYear, in
[Test]
[TestCase("7/29 1:00PM PST", -8, 7, 29, 13, 0, 0)]
[TestCase("7/29 1:00PM pst", -8, 7, 29, 13, 0, 0)]
[TestCase("7/29 1:00PM PDT", -7, 7, 29, 13, 0, 0)]
[TestCase("7/29 1:00PM pdt", -7, 7, 29, 13, 0, 0)]
[TestCase("7/29 1:00PM EST", -5, 7, 29, 13, 0, 0)]
[TestCase("7/29 1:00PM est", -5, 7, 29, 13, 0, 0)]
[TestCase("7/29 1:00PM EDT", -4, 7, 29, 13, 0, 0)]
[TestCase("7/29 1:00PM edt", -4, 7, 29, 13, 0, 0)]
[TestCase("1/21 10:00 AM PST", -8, 1, 21, 10, 0, 0)]
public void ParseTime_WorksAsExpectedWithTimeZone(string input, int expectedOffset, int expectedMonth, int expectedDay, int expectedHour, int expectedMinute, int expectedSecond)
{
var (output, tzi) = ScheduleUtils.ParseTime(input);
Expand Down Expand Up @@ -118,10 +121,13 @@ public void ParseTime_WorksAsExpectedWithTimeZone_2c(string input, int expectedO
[Test]
[TestCase("7/29/2020 1:00PM PST", -8, 2020, 7, 29, 13, 0, 0)]
[TestCase("7/29/2020 1:00PM pst", -8, 2020, 7, 29, 13, 0, 0)]
[TestCase("7/29/2020 1:00PM PDT", -7, 2020, 7, 29, 13, 0, 0)]
[TestCase("7/29/2020 1:00PM pdt", -7, 2020, 7, 29, 13, 0, 0)]
[TestCase("7/29/2020 1:00PM EST", -5, 2020, 7, 29, 13, 0, 0)]
[TestCase("7/29/2020 1:00PM est", -5, 2020, 7, 29, 13, 0, 0)]
[TestCase("7/29/2020 1:00PM EDT", -4, 2020, 7, 29, 13, 0, 0)]
[TestCase("7/29/2020 1:00PM edt", -4, 2020, 7, 29, 13, 0, 0)]
[TestCase("2/11/2024 10:00 AM PST", -8, 2024, 2, 11, 10, 0, 0)]
public void ParseTime_WorksAsExpectedWithYearAndTimeZone(string input, int expectedOffset, int expectedYear, int expectedMonth, int expectedDay, int expectedHour, int expectedMinute, int expectedSecond)
{
var (output, tzi) = ScheduleUtils.ParseTime(input);
Expand Down

0 comments on commit 7deb729

Please sign in to comment.