private static void TestException(testExceptionMethodCallback dlg, IList exceptionList) { Exception ex = Assert.ThrowsAny <Exception>(() => dlg()); foreach (Exception expectedEx in exceptionList) { if ((expectedEx.GetType()) == (ex.GetType())) { return; } } Assert.True(false); }
public void TestException(testExceptionMethodCallback dlg, IList exceptionList) { try { dlg(); Assert.Fail("ccac#A", ((Exception)exceptionList[0]).ToString()); } catch (Exception ex) { foreach (Exception expectedEx in exceptionList) { if ((expectedEx.GetType()) == (ex.GetType())) { return; } } Assert.Fail("ccac#B"); } }
public void TestException(testExceptionMethodCallback dlg, IList exceptionList) { Exception ex = Assert.ThrowsAny<Exception>(() => dlg()); foreach (Exception expectedEx in exceptionList) if ((expectedEx.GetType()) == (ex.GetType())) return; Assert.True(false); }
public void TestException(testExceptionMethodCallback dlg,IList exceptionList) { try { dlg(); Assert.Fail("ccac#A", ((Exception)exceptionList[0]).ToString()); } catch(Exception ex) { foreach(Exception expectedEx in exceptionList) if ( (expectedEx.GetType()) == (ex.GetType()) ) return; Assert.Fail("ccac#B"); } }