[CSHARP-157] In nl-NL culture (and others), the BsonValueIConvertible tests fail Created: 26/Jan/11  Updated: 02/Apr/15  Resolved: 26/Jan/11

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Bug Priority: Trivial - P5
Reporter: Teun Duynstee Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

This line (\BsonUnitTests\ObjectModel\BsonValueIConvertibleTests.cs 144):

            Assert.AreEqual("1.5", Convert.ToString(value));

fails on my machine, because of the nl-NL culture I use.

If you change the line to:

            Assert.AreEqual("1.5", Convert.ToString(value, CultureInfo.InvariantCulture));
            Assert.AreEqual("1,5", Convert.ToString(value, CultureInfo.GetCultureInfo("nl-NL")));

you can see the fail.



 Comments   
Comment by Robert Stam [ 26/Jan/11 ]

Use CultureInfo.InvariantCulture in the unit tests and make sure BsonValue methods pass the provider along.

Generated at Wed Feb 07 21:35:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.