diff --git a/UnitTests/Program.cs b/UnitTests/Program.cs index 0adec4de..5948b8f2 100644 --- a/UnitTests/Program.cs +++ b/UnitTests/Program.cs @@ -153,7 +153,10 @@ public static async Task Main(string[] args) RunTest(RtspClientTests); - await RunTestAsync(TestServerAsync); + RunTest(async () => + { + await RunTestAsync(TestServerAsync); + }); } #region Unit Tests @@ -2147,6 +2150,8 @@ static void TestRtspClient(string location, System.Net.NetworkCredential cred = static async Task TestServerAsync() { + Console.WriteLine(nameof(TestServerAsync)); + System.Runtime.GCLatencyMode oldMode = System.Runtime.GCSettings.LatencyMode; try @@ -4621,19 +4626,14 @@ static void TraceMessage(string message, static void RunTest(Action test, int count = 1, bool waitForGoAhead = true) { + System.Console.Clear(); + Console.WriteLine("About to run test: " + test.Method.Name); + Console.WriteLine("Press Q to skip or any other key to continue."); RunTestAsync(() => { test(); return Task.CompletedTask; }, count, waitForGoAhead).GetAwaiter().GetResult(); } static async Task RunTestAsync(Func test, int count = 1, bool waitForGoAhead = true) { - System.Console.Clear(); - ConsoleColor pForeGround = Console.ForegroundColor, - pBackGound = Console.BackgroundColor; - Console.BackgroundColor = ConsoleColor.Blue; - Console.WriteLine("About to run test: " + test.Method.Name); - Console.WriteLine("Press Q to skip or any other key to continue."); - Console.BackgroundColor = ConsoleColor.Black; - //If the debugger is attached get a ConsoleKey, the key is Q return. if (waitForGoAhead && /*System.Diagnostics.Debugger.IsAttached && */ Console.ReadKey(true).Key == ConsoleKey.Q) return; else @@ -4652,12 +4652,12 @@ static async Task RunTestAsync(Func test, int count = 1, bool waitForGoAhe //Decrement remaining --remaining; - TraceMessage("Beginning Test '" + testIndex + "'", test.Method.Name); + TraceMessage("Beginning Test '" + testIndex + "'"); //Run the test await test(); - TraceMessage("Completed Test'" + testIndex + "'", test.Method.Name); + TraceMessage("Completed Test'" + testIndex + "'"); //Increment the success counter ++successes; @@ -4723,11 +4723,6 @@ static async Task RunTestAsync(Func test, int count = 1, bool waitForGoAhe } } - - Console.BackgroundColor = pBackGound; - - Console.ForegroundColor = pForeGround; - } internal static void TryPrintClientPacket(object sender, bool incomingFlag, Media.Common.IPacket packet, Common.IDisposed context = null, bool writePayload = false)