Get the telemetry version from the --version command and use it to find dotnet.dll

This commit is contained in:
Marc Paine 2022-11-04 22:55:00 -07:00
parent b110fd5fe9
commit 89758ef046

View file

@ -10,7 +10,12 @@ namespace EndToEnd.Tests
[Fact]
public void TelemetryOptOutDefaultAttribute()
{
var dotnetdir = Path.Combine(Path.GetDirectoryName(RepoDirectoriesProvider.DotnetUnderTest), "sdk", "7.0.100");
var result = new DotnetCommand()
.ExecuteWithCapturedOutput("--version");
var sdkVersion = result.StdOut.Trim();
var dotnetdir = Path.Combine(Path.GetDirectoryName(RepoDirectoriesProvider.DotnetUnderTest), "sdk", sdkVersion);
var result = AssemblyInfo.Get(Path.Combine(dotnetdir, "dotnet.dll"), "AssemblyMetadataAttribute");
result.Should().Contain("TelemetryOptOutDefault:False");
}