public void InstallAddsServerTelemetryChannel()
        {
            string    emptyConfig          = ConfigurationHelpers.GetEmptyConfig();
            XDocument configAfterTransform = ConfigurationHelpers.InstallTransform(emptyConfig);

            var typeToFind = typeof(ServerTelemetryChannel);

            var node = ConfigurationHelpers.GetTelemetryChannel(configAfterTransform)
                       .FirstOrDefault(element => element.Attribute("Type").Value == ConfigurationHelpers.GetPartialTypeName(typeToFind));

            Assert.IsNotNull(node);
        }
Example #2
0
        public void InstallAddsAdaptiveTelemetryProcessor()
        {
            string    emptyConfig          = ConfigurationHelpers.GetEmptyConfig();
            XDocument configAfterTransform = ConfigurationHelpers.InstallTransform(emptyConfig);

            var typeToFind = typeof(AdaptiveSamplingTelemetryProcessor);

            var processors = ConfigurationHelpers.GetTelemetryProcessors(configAfterTransform);

            Assert.AreEqual(3, processors.Count());

            var type = processors.FirstOrDefault(element => element.Attribute("Type").Value == ConfigurationHelpers.GetPartialTypeName(typeToFind));

            Assert.IsNotNull(type);

            var excludedTypes = processors.Descendants().Where(element => element.Name.LocalName == "ExcludedTypes").First().Value;

            Assert.AreEqual("Event", excludedTypes);

            var maxItems = processors.Descendants().Where(element => element.Name.LocalName == "MaxTelemetryItemsPerSecond").First().Value;

            Assert.AreEqual("5", maxItems);

            type = processors.LastOrDefault(element => element.Attribute("Type").Value == ConfigurationHelpers.GetPartialTypeName(typeToFind));
            Assert.IsNotNull(type);

            var includedTypes = processors.Descendants().Where(element => element.Name.LocalName == "IncludedTypes").First().Value;

            Assert.AreEqual("Event", includedTypes);

            maxItems = processors.Descendants().Where(element => element.Name.LocalName == "MaxTelemetryItemsPerSecond").Last().Value;
            Assert.AreEqual("5", maxItems);
        }