Allow to change culture in a test#320
Merged
carloscds merged 1 commit intocode-cracker:masterfrom Apr 22, 2015
Merged
Conversation
Closes code-cracker#313, which describes the issue in more detail. It adds the `ChangeCulture` class which changes the current culture during a test. It enables testing on specific cultures, that were harder to test before. It is a simple wrap on the current culture property on the current thread. I also added on every await on the base and helper test classes a `.ConfigureAwait(true)` so that every test always returns on the same thread as it started. If we did not do this then the thread that continues a test may be different from the one that started it, causing a problem on the current culture setting.
|
@giggio I didn´t understand relationship between culture problem and configureawait() |
carloscds
pushed a commit
that referenced
this pull request
Apr 22, 2015
Allow to change culture in a test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #313, which describes the issue in more detail.
It adds the
ChangeCultureclass which changes the current cultureduring a test. It enables testing on specific cultures, that were harder
to test before. It is a simple wrap on the current culture property on
the current thread.
I also added on every await on the base and helper test classes a
.ConfigureAwait(true)so that every test always returns on the samethread as it started. If we did not do this then the thread that
continues a test may be different from the one that started it, causing
a problem on the current culture setting.