Skip to content

Fix some tests that would fail when running under a non en-US culture #5268

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

Merged
merged 1 commit into from
May 21, 2025

Conversation

0xced
Copy link
Contributor

@0xced 0xced commented Aug 30, 2023

Before this commit, two tests would fail with this error (FaultExceptionTest.Serializable_TDetail and FaultExceptionTest.Serializable_Default):

Xunit.Sdk.EqualException
Assert.Equal() Failure
                                 ↓ (pos 1259)
Expected: ···:text><a:xmlLang>en-US</a:xmlLang></a:FaultException.FaultRea···
Actual:   ···:text><a:xmlLang>fr-CH</a:xmlLang></a:FaultException.FaultRea···
                                 ↑ (pos 1259)

Explicitly setting the expected culture with a BeforeAfterTestAttribute solves this issue.

@0xced 0xced force-pushed the fix-unit-tests-on-non-US-culture branch 3 times, most recently from 203c71f to 15f647b Compare December 14, 2023 18:16
Before this commit, two tests would fail with this error (FaultExceptionTest.Serializable_TDetail and FaultExceptionTest.Serializable_Default):
```
Xunit.Sdk.EqualException
Assert.Equal() Failure
                                 ↓ (pos 1259)
Expected: ···:text><a:xmlLang>en-US</a:xmlLang></a:FaultException.FaultRea···
Actual:   ···:text><a:xmlLang>fr-CH</a:xmlLang></a:FaultException.FaultRea···
                                 ↑ (pos 1259)
```

Explicitly setting the expected culture with a `BeforeAfterTestAttribute` solves this issue.
@mconnew mconnew force-pushed the fix-unit-tests-on-non-US-culture branch from 15f647b to 18fed83 Compare May 21, 2025 20:33
@mconnew
Copy link
Member

mconnew commented May 21, 2025

I just rebased your branch so that the latest tests will run. Sorry it took so long to merge this

@mconnew mconnew merged commit 35ff43f into dotnet:main May 21, 2025
8 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants