public static void RunAndGetTheException(
string codeSnippet,
string exceptionType,
string message)
{
//reportRunningCode(codeSnippet);
try{
var coll = PSRunner.Runner.RunPSCode(codeSnippet, showCode);
Assert.Fail();
}
catch (Exception ee) {
Assert.AreEqual(exceptionType, ee.GetType().Name);
if (!ee.Message.Contains(message)) {
Assert.Fail("Exception description does not match: " + ee.Message);
}
}
PSRunner.Runner.FinishRunningCode();
}