예제 #1
0
        public void TracedClassTest()
        {
            var sample = new SampleClass();

            sample.Method1();
            sample.Method2("1", "2");

            sample.TraceInformation("---------------------------------------");

            sample = Extensions.Wrap <SampleClass>(sample);

            sample.Method1();
            sample.Method2("1", "2");

            var listeners = sample.Trace.Listeners;

            //var listener = listeners.OfType<TransactionTraceListener>().First();

            sample.Indent();

            sample.TraceData(TraceEventType.Error, 100, "Error1");

            sample.UnIndent();

            sample.TraceData(TraceEventType.Verbose, 101, "End");
            //var msg = listener.GetTransaction();

            //Trace.WriteLine(msg.Length);
        }