WebConfigTelemetryTests.cs 1.2 KB

123456789101112131415161718192021222324252627
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. namespace Microsoft.NET.Sdk.Publish.Tasks.Tests
  4. {
  5. public class WebConfigTelemetryTests
  6. {
  7. public const string SolutionProjectGuid = "{E4ED9184-8FE6-43CF-8BB6-D708CC720748}";
  8. [Theory]
  9. [InlineData(SolutionProjectGuid)]
  10. public void WebConfigTelemetry_DoesNotSetProjectGuidIfOptedOut_ThroughIgnoreProjectGuid(string projectGuid)
  11. {
  12. // Arrange
  13. XDocument transformedWebConfig = WebConfigTransform.Transform(null, "test.exe", configureForAzure: false, useAppHost: true, extension: ".exe", aspNetCoreModuleName: null, aspNetCoreHostingModel: null, environmentName: null, projectFullPath: null);
  14. Assert.True(XNode.DeepEquals(WebConfigTransformTemplates.WebConfigTemplate, transformedWebConfig));
  15. //Act
  16. XDocument output = WebConfigTelemetry.AddTelemetry(transformedWebConfig, projectGuid, true, null, null);
  17. // Assert
  18. Assert.True(XNode.DeepEquals(WebConfigTransformTemplates.WebConfigTemplate, output));
  19. }
  20. }
  21. }