-
Notifications
You must be signed in to change notification settings - Fork 67
DateTime ConvertFromInvariantString test fail ( as expected ) #98
Comments
@divega what behavior do we want here? Indeed we are always converting from Invariant in the binder, should we try both with Invariant first and then a normal ConvertFromString if the first fails? |
I'd say it is not a good idea to parse with the current culture. Instead, this test should be fixed by setting the culture correctly. What would happen if you have a date string formatted with the |
Yeah I guess what we have is fine, its just a test issue, and invariant string format is the only supported one |
@divega is it expected that we need to support running our tests outside of en-US? Either way the priority of this should be low as its not causing any issues unless you run tests with a different culture... Moving to backlog |
Also, I have filed aspnet/Configuration#348 to follow up on what behavior we want on the product re culture. |
Running unit tests I got fail at
Configure_GetsNullableOptionsFromConfiguration
test for given test datetime, this is expected cause the test try to ConvertFromInvariantString at ConfigurationBinder.cs (ReadValue) where passed input string is generated by the OptionsTest.cs(Configure_GetsNullableOptionsFromConfiguration_Data) where a datetime string is generated using current culture instead of the invariant one.{ nameof(NullableOptions.MyNullableDateTime), new DateTime(1995, 12, 31).ToString(CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern) }
The text was updated successfully, but these errors were encountered: