period instead of comma fails unit test in AppVeyor despite ok in VS2012

Fred's Avatar

Fred

14 Jul, 2015 04:53 PM

Hello,
I have a solution with MS unit tests under Visual Studio 2012:
When I compile in VS 2012, it's ok
When I run unit tests in VS2012, it's ok
In AppVeyor, it give me a failed test:
https://ci.appveyor.com/project/fredatgithub/usefulfunctions/build/tests
here is my test:
[TestMethod]
    public void TestMethod_IsNumeric3_true_Allow_decimal_white()
    {
      const string source = "1234,56";
      const NumberStyles numberStyle = NumberStyles.AllowDecimalPoint;
      const bool expected = true;
      bool result = StringFunc.IsNumeric3(source, numberStyle);
      Assert.AreEqual(result, expected);
    }
Like this, VS2012 passes the test and AppVeyor fails
If I replace the comma with a period in source variable, AppVeyor passes the test and VS2012 fails
I work on a french VS 2012 with a French Windows 7
In France, the decimal separator is a comma and not a period
Is it a bug from AppVeyor ?

  1. Support Staff 1 Posted by Feodor Fitsner on 14 Jul, 2015 09:17 PM

    Feodor Fitsner's Avatar

    You can use Set-Culture cmdlet to change the culture (locale) of current user.

    Add this to Install phase of your project settings (select "PS"):

    Set-Culture fr-FR
    

    Example:
    Failed test: https://ci.appveyor.com/project/FeodorFitsner/vstest-test/build/1.0.24
    Successful test: https://ci.appveyor.com/project/FeodorFitsner/vstest-test/build/1.0.25

    Test source: https://github.com/FeodorFitsner/vstest-test/blob/master/vstest-tes...

  2. 2 Posted by Fred on 15 Jul, 2015 08:02 AM

    Fred's Avatar

    hello Feodor,
    Thank you very much for your help
    it builds ok now :O)

  3. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:57 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac