Co8593ToString_ifp.runTest C# (CSharp) Method

runTest() public method

public runTest ( ) : Boolean
return Boolean
 public Boolean runTest()
   {
   Console.Error.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer);
   int iCountErrors = 0;
   int iCountTestcases = 0;
   String strLoc = "Loc_000oo";
   String strBaseLoc = "Loc_0000oo_";
   String strOut = null;
   NumberFormatInfo nfi1 = new NumberFormatInfo();
   nfi1.NegativeSign = "^";  
   UInt64[] in2TestValues = {UInt64.MinValue, 
			     0,
			     5,
			     13,
			     101,
			     1000,
			     50000,
			     (ulong)Int32.MaxValue,
			     (ulong)Int64.MaxValue,
			     UInt64.MaxValue
   };
   String[] strResultGFormat1 = {"0",
				 "0",  
				 "5",
				 "13",
				 "101",
				 "1000",
				 "50000",
				 "2147483647",
				 "9223372036854775807",
				 "18446744073709551615",
   };
   try {
   strBaseLoc = "Loc_1100ds_";
   for (int i=0; i < in2TestValues.Length;i++)
     {
     strLoc = strBaseLoc+ i.ToString();
     iCountTestcases++;
     strOut = in2TestValues[i].ToString(nfi1);
     if(!strOut.Equals(strResultGFormat1[i]))
       {
       iCountErrors++;
       Console.WriteLine(s_strTFAbbrev+ "Err_293qu! , i=="+i+" strOut=="+strOut);
       }
     }
   } catch (Exception exc_general ) {
   ++iCountErrors;
   Console.WriteLine(s_strTFAbbrev +" Error Err_8888yyy!  strLoc=="+ strLoc +", exc_general=="+exc_general);
   }
   if ( iCountErrors == 0 )
     {
     Console.Error.WriteLine( "paSs.   "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases);
     return true;
     }
   else
     {
     Console.Error.WriteLine("FAiL!   "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors+" , BugNums?: "+s_strActiveBugNums );
     return false;
     }
   }
 public static void Main(String[] args) 

Usage Example

示例#1
0
    public static void Main(String[] args)
    {
        Boolean            bResult = false;
        Co8593ToString_ifp cbA     = new Co8593ToString_ifp();

        try {
            bResult = cbA.runTest();
        } catch (Exception exc_main) {
            bResult = false;
            Console.WriteLine(s_strTFAbbrev + "FAiL! Error Err_9999zzz! Uncaught Exception in main(), exc_main==" + exc_main);
        }
        if (!bResult)
        {
            Console.WriteLine(s_strTFName + s_strTFPath);
            Console.Error.WriteLine(" ");
            Console.Error.WriteLine("FAiL!  " + s_strTFAbbrev);
            Console.Error.WriteLine(" ");
        }
        if (bResult)
        {
            Environment.ExitCode = 0;
        }
        else
        {
            Environment.ExitCode = 1;
        }
    }
All Usage Examples Of Co8593ToString_ifp::runTest
Co8593ToString_ifp