public void TestGetParamNulls()
{
Config cfg = new Config(VALID_APPNAME);
try
{
cfg.GetParameter("Comp1", null);
Assert.Fail("Didn't throw with null param.");
}
catch (ArgumentNullException e)
{
Assert.IsTrue(e.Message.Contains("Comp1"), "Message didn't contain component name.");
}
try
{
cfg.GetParameter(null, "Param1");
Assert.Fail("Didn't throw with null component.");
}
catch (ArgumentNullException e)
{
Assert.IsTrue(e.Message.Contains("Param1"), "Message didn't contain param name.");
}
try
{
cfg.GetParameter(null, null);
Assert.Fail("Didn't throw with two nulls.");
}
catch (ArgumentNullException)
{
// good
}
}