Unit Testing classes using ResourceManager

J

james_c

Hi,

I am writing some unit tests for my windows mobile application.
Unfortunately, some of the code I want to test uses localization strings,
which blow-up my unit tests. I'm guessing this is because the language DLL's
are not being correctly found. Does anyone know how to solve this?

Here's a code snippet example of my unit test that blows up:

[TestMethod()]
public void GetStringsResourceManagerTest()
{
ResourceManager actual;
actual = Utils.GetStringsResourceManager();
Assert.IsNotNull(actual);
String lblPassword = actual.GetString("ACCOUNT_PASSWORD");
Assert.Equals(lblPassword, "PIN");
}

The call to GetString("ACCOUNT_PASSWORD") is throwing the following exception:

System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture,
Boolean createIfNotExists, Boolean tryParents)
System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture,
Boolean createIfNotExists, Boolean tryParents)
System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture,
Boolean createIfNotExists, Boolean tryParents)
System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
System.Resources.ResourceManager.GetString(String name)
MobileUnitTests.UtilsTest.GetStringsResourceManagerTest()

Thanks in advance for any help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top