Skip to content
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

Create a TestCulture attribute to set the culture of the test #579

Open
mika76 opened this issue Mar 12, 2019 · 4 comments · May be fixed by #4055
Open

Create a TestCulture attribute to set the culture of the test #579

mika76 opened this issue Mar 12, 2019 · 4 comments · May be fixed by #4055
Assignees
Labels
Help-Wanted The issue is up-for-grabs, and can be claimed by commenting In-PR

Comments

@mika76
Copy link

mika76 commented Mar 12, 2019

Pretty much the same as NUnit's SetCultureAttribute and SetUICultureAttribute (although I personally don't like the naming convention) and maybe one attribute could be used for both?

@cltshivash cltshivash added enhancement Help-Wanted The issue is up-for-grabs, and can be claimed by commenting labels Mar 15, 2019
@Youssef1313 Youssef1313 self-assigned this Nov 11, 2024
@Youssef1313 Youssef1313 linked a pull request Nov 12, 2024 that will close this issue
@Evangelink
Copy link
Member

Couple of points to discuss/agree upon before we can implement that:

  • which scope to we want to support? test method only? test class? methods including ctor and fixture methods?
  • for test methods, do we want to make the attribute a data source provider? So that when specifying multiple cultures the test would be run multiple times, each with a culture.
  • given @mika76 suggestion, we would probably go for a single attribute. Do we want to have some properties or something to allow the attribute to set only one of the 2 (Culture vs UICulture) or is it mainly pointless?

@mika76
Copy link
Author

mika76 commented Nov 26, 2024

Shoo a lot of time has passed since I posted this so I can't remember what I needed it for exactly, but off the top of my head...

  1. At least methods but class could be quite useful. Really not sure about ctor and fixture methods.
  2. I love this idea - when working with a codebase for an international audience (in my case in Serbia we even have 2 different alphabets) so being able to test multi cultures with one test sounds great!
  3. I personally always use them both together so I would have said one method, but there are times I guess when you want to set one or the other only. If you have 2 they would mostly be copies of each other anyway. So I guess either 2 or make sure you can set them independently if single method.

@Evangelink
Copy link
Member

Oh thanks for taking some time to give us your feedback @mika76 <3

@nohwnd
Copy link
Member

nohwnd commented Nov 27, 2024

That sounds like the best compromise, setting both at the same time, with extra option to set UI separately.

[TestCulture("cs-CZ")]
[TestCuture("cs-CZ", UICulture = "jp-JP")]  // change UI to something different
[TestCulture("en-US", UICulture = "jp-JP")] // "keep" en-US which is my current culture, and change the UI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help-Wanted The issue is up-for-grabs, and can be claimed by commenting In-PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants