jimwang19 / sutekishop

Automatically exported from code.google.com/p/sutekishop
0 stars 0 forks source link

Validation tests, globalization issue #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Build Suteki.Common.Tests project on the machine with culture where 
float-point is not a dot, say ru-RU.
2. Run unit tests.
3. Get a ValidationException "Bind Failed. See ModelStateDictionary for 
errors" in the Suteki.Common.Validation.ValidatingBinder's UpdateFrom 
method. Test failed.

What is the expected output? What do you see instead?
Test ShouldBindCorrectValues() failed. 

What version of the product are you using? On what operating system?
Suteki.Common 1.0.0.0 on localized Windows Vista.

The cure.
Edit ValidatingBinderTest.cs file so the nunit setup code should be like 
that:
        [SetUp]
        public void SetUp()
        {
            Thread.CurrentThread.CurrentCulture = 
CultureInfo.GetCultureInfo("en-US");  // set test's culture 

            validatingBinder = new ValidatingBinder(
                new SimplePropertyBinder(),
                new BooleanPropertyBinder());
        }

Then all test run nice. Thank you!

Original issue reported on code.google.com by brainbo...@gmail.com on 7 Jun 2009 at 5:24

GoogleCodeExporter commented 8 years ago
Fixed in r346.

Thanks brainboost!

Original comment by mikehad...@googlemail.com on 21 Jun 2009 at 10:25