Tests/src/Tests.cs
/// <summary>
/// Shows the errors founded (if any)
/// </summary>
/// <param name="errorsFound">The list of errors. Key=methodName, Value=[expectedErrors, errorsFound]</param>
/// <param name="numberOfTests">Number of tests</param>
Shows the errors founded (if any)
Shows the errors founded ( if any )
private static void showErrors(IDictionary<string, int[]> errorsFound, int numberOfTests) {
#if DEBUG
            Console.WriteLine();
            ConsoleColor previousColor = Console.ForegroundColor;
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("> Successful tests: {0}.", numberOfTests - errorsFound.Count);
            Console.WriteLine("> Erroneous tests: {0}.", errorsFound.Count);
            Console.WriteLine("> Total executed tests: {0}.", numberOfTests);
            if (errorsFound.Count > 0) {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("> Errors:");
                foreach (KeyValuePair<string, int[]> pair in errorsFound)
                    Console.WriteLine(">\t Method {0}: {1} errors expected, {2} found.", pair.Key, pair.Value[0], pair.Value[1]);
            }
            Console.ForegroundColor = previousColor;
            Console.WriteLine();
#endif
        }
private static void showErrors ( IDictionary < string , int [ ] > errorsFound , int numberOfTests ) { if DEBUG Console . WriteLine ( ) ; ConsoleColor previousColor = Console . ForegroundColor ; Console . ForegroundColor = ConsoleColor . Green ; Console . WriteLine ( " " , numberOfTests - errorsFound . Count ) ; Console . WriteLine ( " " , errorsFound . Count ) ; Console . WriteLine ( " " , numberOfTests ) ; if ( errorsFound . Count > 0 ) { Console . ForegroundColor = ConsoleColor . Red ; Console . WriteLine ( " " ) ; foreach ( KeyValuePair < string , int [ ] > pair in errorsFound ) Console . WriteLine ( " \t " , pair . Key , pair . Value [ 0 ] , pair . Value [ 1 ] ) ; } Console . ForegroundColor = previousColor ; Console . WriteLine ( ) ; endif }
Shows the errors founded (if any)
Shows the errors founded ( if any )
errorsFound
IDictionary<string, int[]>
The list of errors. Key=methodName, Value=[expectedErrors, errorsFound]
The list of errors . Key = methodName Value = [ expectedErrors errorsFound ]
numberOfTests
int
Number of tests
Number of tests