public void UninstallRemovesAllTelemetryInitailizers() { string emptyConfig = ConfigurationHelpers.GetEmptyConfig(); XDocument configAfterInstall = ConfigurationHelpers.InstallTransform(emptyConfig); XDocument configAfterUninstall = ConfigurationHelpers.UninstallTransform(configAfterInstall.ToString()); Assert.AreEqual(0, ConfigurationHelpers.GetTelemetryInitializers(configAfterUninstall).ToList().Count); }
public void UninstallDoesNotRemovesTelemetryInitailizersTagIfCustomTelemetryInitializerPresent() { string emptyConfig = ConfigurationHelpers.GetEmptyConfig(); XDocument configAfterInstall = ConfigurationHelpers.InstallTransform(emptyConfig); // Replace valid type on custom so during uninstall it should stay in the config string customConfig = configAfterInstall.ToString().Replace("BuildInfoConfigComponentVersionTelemetryInitializer", "blah"); XDocument configAfterUninstall = ConfigurationHelpers.UninstallTransform(customConfig); Assert.AreEqual(1, ConfigurationHelpers.GetTelemetryInitializers(configAfterUninstall).ToList().Count); Assert.AreEqual(1, ConfigurationHelpers.GetTelemetryInitializers(configAfterUninstall).Descendants().ToList().Count); }
public void UninstallDoesNotRemoveTelemetryModulesTagIfCustomTelemetryModuleIsPresent() { string emptyConfig = ConfigurationHelpers.GetEmptyConfig(); XDocument configAfterInstall = ConfigurationHelpers.InstallTransform(emptyConfig); // Replace valid type on custom so during uninstall it should stay in the config string customConfig = configAfterInstall.ToString().Replace("DeveloperModeWithDebuggerAttachedTelemetryModule", "blah"); XDocument configAfterUninstall = ConfigurationHelpers.UninstallTransform(customConfig); Assert.AreEqual(1, ConfigurationHelpers.GetTelemetryModules(configAfterUninstall).ToList().Count); Assert.AreEqual(1, ConfigurationHelpers.GetTelemetryModules(configAfterUninstall).Descendants().ToList().Count); }