Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [TestMethod]
- public void TestGetCountry()
- {
- string expected = Address.GetCountry();
- Delegate action = StringGenerators.GetStringGenerator(Enums.StringGenerators.COUNTRY);
- string[] args = new string[] { "" };
- string actual = (string)action.DynamicInvoke(args);
- Assert.AreEqual(expected, actual, "Country does not match");
- }
- [TestMethod]
- public void TestGetState()
- {
- string expected = "CA";
- Delegate action = StringGenerators.GetStringGenerator(Enums.StringGenerators.STATE);
- string[] args = new string[] {"CA", "NY"};
- string actual = (string)action.DynamicInvoke(args); // exception thrown here
- Assert.AreEqual(expected, actual, "State does not match");
- }
- public static string GetCountry(object container)
- {
- return Address.GetCountry();
- }
- public static string GetState(object container)
- {
- string[] states = (string[])container;
- int index = SeedGovernor.GetRandomInt(states.Length);
- return states[index];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement