public void ErrorTelemetryEventsContainDetailedInfo() { TestTelemetryChannel.Clear(); var host = new HostingContext <SimpleService, ISimpleService>() .ShouldWaitForCompletion(); using (host) { host.Open(); ISimpleService client = host.GetChannel(); try { client.CallFailsWithFault(); } catch { } } var error = (from item in TestTelemetryChannel.CollectedData() where item is ExceptionTelemetry select item).Cast <ExceptionTelemetry>().First(); Assert.IsNotNull(error.Exception); Assert.IsNotNull(error.Context.Operation.Id); Assert.IsNotNull(error.Context.Operation.Name); }
public void ErrorTelemetryEventsAreGeneratedOnFault() { TestTelemetryChannel.Clear(); var host = new HostingContext <SimpleService, ISimpleService>() .ShouldWaitForCompletion(); using (host) { host.Open(); ISimpleService client = host.GetChannel(); try { client.CallFailsWithFault(); } catch { } } var errors = from item in TestTelemetryChannel.CollectedData() where item is ExceptionTelemetry select item; Assert.IsTrue(errors.Count() > 0); }