System.Xml.Tests.CExceptionHandler.VerifyException C# (CSharp) Méthode

VerifyException() public méthode

public VerifyException ( Exception ex ) : bool
ex System.Exception
Résultat bool
        public bool VerifyException(Exception ex)
        {
            Type _type = ex.GetType();
            res = String.Empty;//(string)_type.InvokeMember("res", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance, null, ex, null);
            msg = (string)_nav.Evaluate("string(/exceptions/exception [@res = '" + res + "']/@message)");
            try
            {
                _exVer.IsExceptionOk(ex, res);
                return true;
            }
            catch (Exception exp)
            {
                _output.WriteLine(exp.Message);
                return false;
            }
        }

Same methods

CExceptionHandler::VerifyException ( Exception ex, string res, string strParams ) : bool
CExceptionHandler::VerifyException ( Exception ex, string res, string strParams, LineInfo lInfo ) : bool

Usage Example

Exemple #1
0
 // --------------------------------------------------------------------------------------------------------------
 //  CheckExpectedError
 //  -------------------------------------------------------------------------------------------------------------
 public void CheckExpectedError(Exception ex, string assembly, string res, string[] strParams)
 {
     CExceptionHandler handler = new CExceptionHandler(_strPath + "exceptions.xml", assembly, _output);
     if (!handler.VerifyException(ex, res, strParams))
     {
         Assert.True(false);
     }
     return;
 }
All Usage Examples Of System.Xml.Tests.CExceptionHandler::VerifyException