Skip to content

Allow to change culture in a test#320

Merged
carloscds merged 1 commit intocode-cracker:masterfrom
giggio:change-culture
Apr 22, 2015
Merged

Allow to change culture in a test#320
carloscds merged 1 commit intocode-cracker:masterfrom
giggio:change-culture

Conversation

@giggio
Copy link
Copy Markdown
Member

@giggio giggio commented Apr 21, 2015

Closes #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.

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.
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 89.82% when pulling cd16f8f on giggio:change-culture into b3cd494 on code-cracker:master.

@carloscds
Copy link
Copy Markdown

@giggio I didn´t understand relationship between culture problem and configureawait()

@carloscds carloscds self-assigned this Apr 22, 2015
carloscds pushed a commit that referenced this pull request Apr 22, 2015
Allow to change culture in a test
@carloscds carloscds merged commit 3e5f4cd into code-cracker:master Apr 22, 2015
@giggio giggio deleted the change-culture branch April 23, 2015 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create infrastructure for testing multi culture values

3 participants