-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find a clean way to run all unit tests multiple times with different regional settings #42
Comments
Some advice around it... https://groups.google.com/forum/m/?fromgroups#!topic/nunit-discuss/2uakIeP0mOE |
I have implemented an helper function that runs all present nUnit tests (using reflection). One just has to wrap them with SetCultureAttribute. See in LocaleCheck.cs [Test]
[SetCulture("fr-CA")]
public void CanadianFrench()
{
RunnerHelper.RunAllTests();
} I guess you will be able to close this one. |
That was fast ;-) But what about time zone ? I haven't find a clean way to handle that unless you always use UTC for date time related test otherwise expected exception test will failed since local date time string will be different... Great job by the way! |
I think it may be possible to introduce a DateTime formater that will format all unspecified/locale date kind to a specific locale+ timezone like in java Joda time. Do you think we should POC this kind of solution ? I could go deeper on that if you want.... |
Hello Marc-Antoine, 1: Do not add constraints to NFluent implementors:
2: Help contributors (us) achieve those objectives 3: ultimately, help NFluent implementors implement locale insensitive code Regartim item 2, I think we have to avoid any specific test were we force Your thoughts? Le vendredi 10 mai 2013, Marc-Antoine Latour a écrit :
Envoyé depuis mon IPad |
Hi Cyrille, What I try to achieve is to be able to support DateTime kind local properly, by now all related DateTime test are using UTC or unspecified date kind since locale date time will have different representation depending of your time zone and will make some unit test failing if the test is using the expectedexception message attribute (me and Thomas was playing ping/pong with those test ;-) works in Montreal but not in Paris or viceversa). Also, another requirement is to support string as input for date time (issue #28), thus, it will be hard to run those test with multiple culture since it could dramatically change the input string format. So I was thinking that maybe we could allowed the developer to force a specific format using this kind of syntax : Check.That(new DateTime(2000,1,1)).UsingFormat("MM/dd/YYYY").IsBefore("01/1/2001") It's is more a brainstorming than a proposal, since I plan to work on the issue #28 shortly Best regards Sent from my iPad On 2013-05-10, at 4:14, "Cyrille DUPUYDAUBY" [email protected] wrote:
|
So that we won't encounter regional settings related issues.
The text was updated successfully, but these errors were encountered: