Exemplo n.º 1
0
 public static void ValidateErrReport(ErrReport err, int code, string atClass, string atMethod, string msg, List <string> stackText)
 {
     TestHelpersNet.ErrToConsole(err);
     Assert.AreEqual(code, err.Code);
     Assert.AreEqual(atClass, err.AtClass);
     Assert.AreEqual(atMethod, err.AtMethod);
     Assert.AreEqual(msg, err.Msg);
     ValidateErrReportStack(err, stackText);
 }
Exemplo n.º 2
0
        public static ErrReport CatchExpected(int code, string atClass, string atMethod, string msg, Action action)
        {
            ErrReport err = new ErrReport();

            WrapErr.ToErrReport(out err, -999999, "Unexpected Error running Test", () => {
                action.Invoke();
            });
            Assert.AreNotEqual(-999999, err.Code, "The CatchExpected has put out its own error {0}", err.Code);
            TestHelpersNet.ValidateErrReport(err, code, atClass, atMethod, msg);
            return(err);
        }
Exemplo n.º 3
0
        public static void CatchUnexpected(Action action)
        {
            ErrReport err = new ErrReport();

            WrapErr.ToErrReport(out err, -1, "Unexpected Error running Test", () => {
                action.Invoke();
            });
            if (err.Code != 0)
            {
                TestHelpersNet.ErrToConsole(err);
                Assert.Fail("Unexpected Exception Occured on test:{0} {1}", err.Code, err.Msg);
            }
        }