Azavea.Open.Common.Tests.ConfigTests.GetParamInvalidHelper C# (CSharp) Method

GetParamInvalidHelper() private static method

Call GetParameter with invalid params, catch the exception and check the message.
private static GetParamInvalidHelper ( Config cfg, string comp, string parm, string testDesc ) : void
cfg Config
comp string
parm string
testDesc string
return void
        private static void GetParamInvalidHelper(Config cfg, string comp, string parm, string testDesc)
        {
            try
            {
                cfg.GetParameter(comp, parm);
                Assert.Fail("Test '" + testDesc + " didn't throw with comp '" + comp + "' param '" +
                    parm + "'.");
            }
            catch (Exception e)
            {
                Assert.IsTrue(e.Message.Contains(comp), "Test '" + testDesc +
                    " threw an exception without comp '" + comp +
                    "' in the description (param was'" + parm + "'.");
                Assert.IsTrue(e.Message.Contains(parm), "Test '" + testDesc +
                    " threw an exception without param '" + parm +
                    "' in the description (comp was'" + comp + "'.");
            }
        }