public void CallCanFlowRootOperationId() { TestTelemetryChannel.Clear(); var host = new HostingContext<SelectiveTelemetryService, ISelectiveTelemetryService>(); using ( host ) { host.Open(); ISelectiveTelemetryService client = host.GetChannel(); using ( var scope = new OperationContextScope((IContextChannel)client) ) { var rootId = new RootIdMessageHeader(); rootId.RootId = "rootId"; OperationContext.Current.OutgoingMessageHeaders.Add(rootId); client.OperationWithTelemetry(); } } Assert.AreEqual("rootId", TestTelemetryChannel.CollectedData().First().Context.Operation.Id); }
public void CallCanFlowRootOperationId() { TestTelemetryChannel.Clear(); var host = new HostingContext <SelectiveTelemetryService, ISelectiveTelemetryService>(); using ( host ) { host.Open(); ISelectiveTelemetryService client = host.GetChannel(); using (var scope = new OperationContextScope((IContextChannel)client)) { var rootId = new RootIdMessageHeader(); rootId.RootId = "rootId"; OperationContext.Current.OutgoingMessageHeaders.Add(rootId); client.OperationWithTelemetry(); } } Assert.AreEqual("rootId", TestTelemetryChannel.CollectedData().First().Context.Operation.Id); }