##// END OF EJS Templates
Removed obsolete App, ComponentContainer...
Removed obsolete App, ComponentContainer Extracted IAsyncComponent interface Working on RunnableComponent

File last commit:

r256:c52691faaf21 v3
r256:c52691faaf21 v3
Show More
UnitTest1.cs
40 lines | 1.6 KiB | text/x-csharp | CSharpLexer
cin
Implab.Test moved to xunit...
r249 using System;
cin
Prerelease version of RunnableComponent...
r251 using System.Diagnostics;
cin
Implab.Test moved to xunit...
r249 using System.Threading;
cin
removed absolete Diagnostics classes
r252 using Implab.Diagnostics;
cin
Removed obsolete App, ComponentContainer...
r256 using System.Linq;
cin
Implab.Test moved to xunit...
r249 using Xunit;
cin
Implab.Diagnostics drafts
r253 namespace Implab.Test {
using System.Threading.Tasks;
cin
removed absolete Diagnostics classes
r252 using static Trace<UnitTest1>;
cin
Implab.Diagnostics drafts
r253 public class UnitTest1 {
cin
Implab.Test moved to xunit...
r249 [Fact]
cin
Implab.Diagnostics drafts
r253 public async Task Test1() {
var listener = new SimpleTraceListener(Console.Out);
cin
Removed obsolete App, ComponentContainer...
r256 listener.TraceOutputOptions |= TraceOptions.ThreadId;
cin
Implab.Diagnostics drafts
r253
cin
removed absolete Diagnostics classes
r252 var source = TraceSource;
source.Switch.Level = SourceLevels.All;
cin
Prerelease version of RunnableComponent...
r251
source.Listeners.Add(listener);
cin
Removed obsolete App, ComponentContainer...
r256 using (LogicalOperation("Test1")){
cin
Implab.Diagnostics drafts
r253 await Task.Yield();
cin
Removed obsolete App, ComponentContainer...
r256 Log(String.Join(", ", Trace.CorrelationManager.LogicalOperationStack.Cast<object>().Select(x => x.ToString())));
await AsyncDummy();
Log(String.Join(", ", Trace.CorrelationManager.LogicalOperationStack.Cast<object>().Select(x => x.ToString())));
cin
Implab.Diagnostics drafts
r253 }
cin
Implab.Test moved to xunit...
r249 }
cin
Removed obsolete App, ComponentContainer...
r256
async Task AsyncDummy() {
using(LogicalOperation("OuterDummy"))
using(LogicalOperation("InnerDummy")) {
Log(String.Join(", ", Trace.CorrelationManager.LogicalOperationStack.Cast<object>().Select(x => x.ToString())));
await Task.Delay(1);
Log(String.Join(", ", Trace.CorrelationManager.LogicalOperationStack.Cast<object>().Select(x => x.ToString())));
}
Log(String.Join(", ", Trace.CorrelationManager.LogicalOperationStack.Cast<object>().Select(x => x.ToString())));
}
cin
Implab.Test moved to xunit...
r249 }
}