diff Implab.Test/UnitTest1.cs @ 251:7c7e9ad6fe4a v3

Prerelease version of RunnableComponent Added draft messaging interfaces Added more more helpers to Xml/SerializationHelpers
author cin
date Sun, 11 Feb 2018 00:49:51 +0300
parents d82909310094
children 6f4630d0bcd9
line wrap: on
line diff
--- a/Implab.Test/UnitTest1.cs	Thu Feb 01 02:43:35 2018 +0300
+++ b/Implab.Test/UnitTest1.cs	Sun Feb 11 00:49:51 2018 +0300
@@ -1,4 +1,5 @@
 using System;
+using System.Diagnostics;
 using System.Threading;
 using Xunit;
 
@@ -9,9 +10,20 @@
         [Fact]
         public void Test1()
         {
-            using(var cts = new CancellationTokenSource(1000)) {
-                PromiseHelper.Sleep(10000, cts.Token).Join();
-            }
+            var listener = new TextWriterTraceListener(Console.Out);
+            var source = new TraceSource("Custom",SourceLevels.ActivityTracing);
+
+            source.Listeners.Add(listener);
+
+            Trace.Listeners.Add(listener);
+            Trace.WriteLine("Hello!");
+            Trace.CorrelationManager.StartLogicalOperation();
+            Trace.WriteLine("Inner");
+            foreach(var x in Trace.CorrelationManager.LogicalOperationStack)
+                Trace.WriteLine($"-{x}");
+            source.TraceEvent(TraceEventType.Information, 1, "source event");
+            source.TraceData(TraceEventType.Start, 1, DateTime.Now);
+            Trace.CorrelationManager.StopLogicalOperation();
         }
     }
 }