Skip to content

CSharpHelper depends on the local system's culture #2143

@MichaelKetting

Description

@MichaelKetting

When running the tests in CSharpHelperTest on a system using a culture other than US English, the tests fail because the date and number formats are different from the expectation.

Test output (abbreviated) when running with German Culture settings:

Microsoft.Data.Entity.Commands.Utilities.CSharpHelperTest.Literal_works_when_DateTime [FAIL]
Assert.Equal() Failure
Expected: DateTime.Parse("3/12/2015 12:00:00 AM")
Actual: DateTime.Parse("12.03.2015 00:00:00")

Microsoft.Data.Entity.Commands.Utilities.CSharpHelperTest.Literal_works_when_DateTimeOffset [FAIL]
Assert.Equal() Failure
Expected: ···teTimeOffset.Parse("3/12/2015 12:00:00 AM -07:00")
Actual: ···teTimeOffset.Parse("12.03.2015 00:00:00 -07:00")

Microsoft.Data.Entity.Commands.Utilities.CSharpHelperTest.Literal_works_when_decimal [FAIL]
Assert.Equal() Failure
Expected: 4.2m
Actual: 4,2m

Microsoft.Data.Entity.Commands.Utilities.CSharpHelperTest.Literal_works(value: 4,2, expected: "4.2") [FAIL]
Assert.Equal() Failure
Expected: 4.2
Actual: 4,2

Microsoft.Data.Entity.Commands.Utilities.CSharpHelperTest.Literal_works(value: 4,2, expected: "4.2f") [FAIL]
Assert.Equal() Failure
Expected: 4.2f
Actual: 4,2f

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions