Merge pull request #7112 from dotnet/merges/release/2.0.0-to-master-20170710-070027

Merge release/2.0.0 to master
This commit is contained in:
Tom Meschter 2017-07-10 08:54:29 -07:00 committed by GitHub
commit 5a37290f24
9 changed files with 129 additions and 15 deletions

View file

@ -17,14 +17,15 @@ namespace Microsoft.DotNet.Tests
public bool Enabled { get; set; }
public string EventName { get; set; }
public IDictionary<string, string> Properties { get; set; }
public void TrackEvent(string eventName, IDictionary<string, string> properties, IDictionary<string, double> measurements)
{
EventName = eventName;
Properties = properties;
}
}
public class TelemetryCommandTests : TestBase
{
[Fact]
@ -35,5 +36,23 @@ namespace Microsoft.DotNet.Tests
Microsoft.DotNet.Cli.Program.ProcessArgs(args, mockTelemetry);
Assert.Equal(mockTelemetry.EventName, args[0]);
}
[WindowsOnlyFact]
public void InternalreportinstallsuccessCommandCollectExeNameWithEventname()
{
MockTelemetry mockTelemetry = new MockTelemetry();
string[] args = { "c:\\mypath\\dotnet-sdk-latest-win-x64.exe" };
InternalReportinstallsuccess.ProcessInputAndSendTelemetry(args, mockTelemetry);
mockTelemetry.EventName.Should().Be("reportinstallsuccess");
mockTelemetry.Properties["exeName"].Should().Be("dotnet-sdk-latest-win-x64.exe");
}
[Fact]
public void InternalreportinstallsuccessCommandIsRegistedInBuiltIn()
{
BuiltInCommandsCatalog.Commands.Should().ContainKey("internal-reportinstallsuccess");
}
}
}