Esempio n. 1
0
        public static void VerifyDependency(TelemetryItem telemetryItem, ExpectedTelemetryItemValues expectedVars)
        {
            Assert.Equal("RemoteDependency", telemetryItem.Name);
            Assert.Equal(nameof(RemoteDependencyData), telemetryItem.Data.BaseType);

            var data = (RemoteDependencyData)telemetryItem.Data.BaseData;

            Assert.Equal(expectedVars.Name, data.Name);
            Assert.Equal(expectedVars.CustomProperties, data.Properties);
        }
Esempio n. 2
0
        public static void Verify(TelemetryItem telemetryItem, ActivityKind activityKind, ExpectedTelemetryItemValues expectedVars)
        {
            switch (activityKind)
            {
            case ActivityKind.Client:
            case ActivityKind.Producer:
            case ActivityKind.Internal:
                VerifyDependency(telemetryItem, expectedVars);
                break;

            case ActivityKind.Consumer:
            case ActivityKind.Server:
                VerifyRequest(telemetryItem, expectedVars);
                break;

            default:
                throw new Exception($"unknown ActivityKind '{activityKind}'");
            }
        }