How can I use my localizations in a test? #1259
Replies: 1 comment 1 reply
-
I think you need to run the tests using a specific culture, which is what things like string formatting etc. uses to convert types to text during rendering. xUnit has a sample attribute you can add to your test project, which allows you to specify a culture per test: https://github.com/xunit/samples.xunit/blob/main/UseCulture/UseCultureAttribute.cs And yes, we should probably add a page to our docs that shows how to do this. If you figure out a good way, feel free to contribute a page to our docs. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all;
I want to get the text I have in the app's localization resource to compare with what is displayed on the page. I found this in the documentation - nothing written.
Important to this:
In other words, mocking it won't answer my use case.
thanks - dave
Beta Was this translation helpful? Give feedback.
All reactions