/// <inheritdoc/> public override int GetHashCode() { unchecked { int result = (Type != null ? Type.GetHashCode() : 0); result = (result * 397) ^ CanRead.GetHashCode(); result = (result * 397) ^ CanWrite.GetHashCode(); result = (result * 397) ^ (Query != null ? Query.GetHashCode() : 0); return(result); } }
/// <summary> /// Overrides the ToString method and formats the string output. /// </summary> /// <returns>A desired format for the member description.</returns> public override string ToString() { string s = Name + "\n"; if (!string.IsNullOrEmpty(Description)) { s += Description + "\n"; } s += @"Can Read: " + CanRead.ToString() + "\n"; s += @"Can Write: " + CanWrite.ToString() + "\n"; return(s); }
public static void Main(string[] args) { CanRead objTest = new CanRead(); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(objTest.AppDomainUnhandledException_EventHandler); Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer); try { objTest.RunTest(); } catch (Exception e) { Console.WriteLine(s_strTFAbbrev + " : FAIL The following exception was thorwn in RunTest(): \n" + e.ToString()); objTest._numErrors++; objTest._exitValue = TCSupport.FailExitCode; } //// Finish Diagnostics if (objTest._numErrors == 0) { Console.WriteLine("PASS. "+ s_strTFPath + " " + s_strTFName + " ,numTestcases==" + objTest._numTestcases); } else { Console.WriteLine("FAIL! "+ s_strTFPath + " " + s_strTFName + " ,numErrors==" + objTest._numErrors); if (TCSupport.PassExitCode == objTest._exitValue) { objTest._exitValue = TCSupport.FailExitCode; } } Environment.ExitCode = objTest._exitValue; }