Unit Testing iPhone Code That Uses NSLocalizedString
- by Jay Haase
I have an iPhone iOS4.1 application that uses localized strings. I have just started building unit tests using the SenTestingKit. I have been able to successfully test many different types of values.
I am unable to correctly test any of my code that uses NSLocalizedString calls, because when the code runs in my LogicTests target, all of my NSLocalizedString calls only return the string key.
I have added my Localizable.strings file to the LogicTests target.
My question is: How must I configure my LogicTests target so that calls to NSLocalizedString will return the localized string and not the string key.