예제 #1
0
        // 测试没有抛出指定的异常
        public static void AssertNoException(Action action, Type e = null)
        {
            if (General.AssertExceptionOccured(action, e))
            {
                Assert.Fail();
            }

            //bool isSuccessed = false;
            //try {
            //    action.Invoke();
            //}
            //catch (Exception ex) {
            //    if (e == null || e == ex.GetType()) {
            //        isSuccessed = true;
            //    }
            //}
            //if (isSuccessed) {
            //    Assert.Fail();
            //}
        }