private static StupidStringClient.Entry[] RunDependentActivity(ActivityMonitor.DependentToken token) { string depMonitorTopic = null; StupidStringClient.Entry[] dependentLogs = null; var task = Task.Factory.StartNew(t => { StupidStringClient cStarted = new StupidStringClient(); using (var depMonitor = token.CreateDependentMonitor(mD => mD.Output.RegisterClient(cStarted))) { depMonitorTopic = depMonitor.Topic; depMonitor.Trace().Send("Hello!"); } dependentLogs = cStarted.Entries.ToArray(); }, token); task.Wait(); Assert.That(depMonitorTopic, Is.EqualTo(token.Topic)); return(dependentLogs); }