public void ConsoleTest2() { lock (mutex) { Perf.ClearHandlers(); Perf.UseConsole(); Perf.UseUdpClient("127.0.0.1", 26778); using (ConsoleAgent.Begin()) { Perf.Set(); Thread.Sleep(1); Perf.Set("P2"); Thread.Sleep(1); Perf.End(); var output = ConsoleAgent.ReadAllText(); Assert.True(output.IsMatch(new Regex(@"\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} #\d+ UnitTest1.cs \( \d+ ~ \d+ \) \d{2}:\d{2}:\d{2}\.\d{7} \d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} #\d+ UnitTest1.cs \( P2 \) \d{2}:\d{2}:\d{2}.\d{7} "))); } } }