public void SetupContext() { TracerLibrary.Tracer tracer = new TracerLibrary.Tracer(); new Foo(tracer).MyMethod(); Thread thrd1 = new Thread(new ThreadStart(new Bar(tracer).InnerMethod)); thrd1.Start(); thrd1.Join(); result = tracer.GetTraceResult(); }
public void TestExecTime() { Stopwatch testTracer = new Stopwatch(); testTracer.Start(); Thread.Sleep(2000); TracerLibrary.Tracer tracer = new TracerLibrary.Tracer(); new Foo(tracer).Test(); result = tracer.GetTraceResult(); testTracer.Stop(); Assert.IsTrue(testTracer.ElapsedMilliseconds >= result._threads[0].millisecinds); }
static void Main(string[] args) { TracerLibrary.Tracer tracer = new TracerLibrary.Tracer(); Thread thrd1 = new Thread(new ThreadStart(new Bar(tracer).InnerMethod)); new Foo(tracer).MyMethod(); thrd1.Start(); thrd1.Join(); TraceResult result = tracer.GetTraceResult(); new FileOutput().printResult(result.getXMLResult()); new ConsoleOutput().printResult(result.getXMLResult()); Console.ReadKey(); }