public static void PathTooLongException_ctor_string_exception() { string message = "This path is too long to hike in a single day."; Exception innerException = new Exception("Inner exception"); PathTooLongException plte = new PathTooLongException(message, innerException); Utility.ValidateExceptionProperties(plte, hResult: HResults.COR_E_PATHTOOLONG, innerException: innerException, message: message); }
public bool PosTest3() { bool retVal = true; TestLibrary.TestFramework.BeginScenario("PosTest3: Create a new PathTooLongException instance,string is null."); try { string expectString = null; PathTooLongException myException = new PathTooLongException(expectString); if (myException == null) { TestLibrary.TestFramework.LogError("003.1", "the PathTooLongException ctor error occurred. "); retVal = false; } } catch (Exception e) { TestLibrary.TestFramework.LogError("003.2", "Unexpected exception: " + e); retVal = false; } return retVal; }
public bool PosTest2() { bool retVal = true; TestLibrary.TestFramework.BeginScenario("PosTest2: Create a new PathTooLongException instance,string is empty."); try { string expectString = string.Empty; PathTooLongException myException = new PathTooLongException(expectString); if (myException.Message != expectString) { TestLibrary.TestFramework.LogError("002.1", "the PathTooLongException ctor error occurred. "); retVal = false; } } catch (Exception e) { TestLibrary.TestFramework.LogError("002.2", "Unexpected exception: " + e); retVal = false; } return retVal; }
public static void PathTooLongException_ctor() { PathTooLongException plte = new PathTooLongException(); Utility.ValidateExceptionProperties(plte, hResult: HResults.COR_E_PATHTOOLONG, validateMessage: false); }