mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-22 04:35:52 +12:00
Begin work on Unit Tests
This commit is contained in:
parent
cf7605c6c9
commit
eaf1db1ee1
51 changed files with 3883 additions and 2101 deletions
51
HorseIsleServer/HISPtests/ResultLogger.cs
Normal file
51
HorseIsleServer/HISPtests/ResultLogger.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HISP.Tests
|
||||
{
|
||||
public class ResultLogger
|
||||
{
|
||||
public static void LogTestStatus(bool successful, string testname, string message)
|
||||
{
|
||||
if (successful)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
Console.Out.Write("[ " + testname + " ] ");
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Out.WriteLine("* " + message + " *");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
Console.Error.Write("[ " + testname + " ] ");
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.Error.WriteLine("* " + message + " *");
|
||||
}
|
||||
}
|
||||
|
||||
public static void LogTestResult(bool successful, string testname, string message, string expected)
|
||||
{
|
||||
if (successful)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
Console.Out.Write("[ " + testname + " ] ");
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Out.WriteLine("* " + message + " == " + expected + " *");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
Console.Error.Write("[ " + testname + " ] ");
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.Error.WriteLine("* " + message + " != " + expected + " *");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue