This is a simple question : is it possible to change the locale while unit testing ?
I'd like to check that my label is "Monday" in english and "lundi" in french for example.
This is a simple question : is it possible to change the locale while unit testing ?
I'd like to check that my label is "Monday" in english and "lundi" in french for example.
Copyright © 2021 Jogjafile Inc.
The situation you describe sounds more like an integration test than a unit test; you're changing the environment in which the app runs and ensuring that the app's behaviour changes accordingly. It's the sort of thing I'd check with UIAutomation.
In a unit test situation, you might have a method that prepares the label text: you can create arbitrary NSLocale instances, and assert that the correct strings table is used for each locale in your test fixtures.