-
Notifications
You must be signed in to change notification settings - Fork 191
Adds new Date Format String for HttpRuleParser (#507) #897
Conversation
CLA required? @Eilon was it just the public one? https://github.com/aspnet/Home/blob/master/CONTRIBUTING.md#contributing-code-and-content |
I worked it out with @jkotalik so I think he'll be fine once he completes the process. |
CheckValidParsedValue("Tue, 15 Nov 1994 08:12:31 GMT", new DateTimeOffset(1994, 11, 15, 8, 12, 31, TimeSpan.Zero)); | ||
CheckValidParsedValue(" Sunday, 06-Nov-94 08:49:37 GMT ", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero)); | ||
CheckValidParsedValue(" Tue,\r\n 15 Nov\r\n 1994 08:12:31 GMT ", new DateTimeOffset(1994, 11, 15, 8, 12, 31, TimeSpan.Zero)); | ||
CheckValidParsedValue("Sat, 09-Dec-2017 07:07:03 GMT ", new DateTimeOffset(2017, 12, 09, 7, 7, 3, TimeSpan.Zero)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should change this to a Theory
test - one for each case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending comments and CLA
CheckValidParsedValue("Tue, 15 Nov 1994 08:12:31 GMT", new DateTimeOffset(1994, 11, 15, 8, 12, 31, TimeSpan.Zero)); | ||
CheckValidParsedValue(" Sunday, 06-Nov-94 08:49:37 GMT ", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero)); | ||
CheckValidParsedValue(" Tue,\r\n 15 Nov\r\n 1994 08:12:31 GMT ", new DateTimeOffset(1994, 11, 15, 8, 12, 31, TimeSpan.Zero)); | ||
CheckValidParsedValue(input, expected); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't still need CheckValidParsedValue and CheckInvalidParsedValue do you?
@jkotalik, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request. |
@Eilon 🆙 📅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved for style, but I didn't look at the actual code.
{ | ||
[Fact] | ||
public void TryParse_SetOfValidValueStrings_ParsedCorrectly() | ||
[Theory, MemberData(nameof(ValidStringData))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per my comment in some other PR, split the attributes into two lines, each like [Foo]
.
yield return new object[] { "Sat, 09-Dec-2017 07:07:03 GMT ", new DateTimeOffset(2017, 12, 09, 7, 7, 3, TimeSpan.Zero) }; | ||
} | ||
|
||
[Theory, MemberData(nameof(InvalidStringData))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this one.
839ee22
to
538cbf0
Compare
@Tratcher Went ahead and refactored the helpers. Will wait for this build to succeed to merge in. |
5370edd
to
8bc2e53
Compare
8bc2e53
to
b41d865
Compare
@Tratcher