Merge pull request #2145 from dotnet/lakshanf/issue2066/telemetry
Lakshanf/issue2066/telemetry
This commit is contained in:
commit
965547bd8a
13 changed files with 259 additions and 48 deletions
36
test/dotnet.Tests/TelemetryCommandTest.cs
Normal file
36
test/dotnet.Tests/TelemetryCommandTest.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.Cli;
|
||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||
using Xunit;
|
||||
using FluentAssertions;
|
||||
|
||||
namespace Microsoft.DotNet.Tests
|
||||
{
|
||||
public class MockTelemetry : ITelemetry
|
||||
{
|
||||
public string EventName{get;set;}
|
||||
public void TrackEvent(string eventName, IDictionary<string, string> properties, IDictionary<string, double> measurements)
|
||||
{
|
||||
EventName = eventName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class TelemetryCommandTests : TestBase
|
||||
{
|
||||
[Fact]
|
||||
public void TestProjectDependencyIsNotAvailableThroughDriver()
|
||||
{
|
||||
MockTelemetry mockTelemetry = new MockTelemetry();
|
||||
string[] args = { "help" };
|
||||
Program.ProcessArgs(args, mockTelemetry);
|
||||
Assert.Equal(mockTelemetry.EventName, args[0]);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,6 +6,9 @@
|
|||
"Microsoft.DotNet.Tools.Tests.Utilities": {
|
||||
"target": "project"
|
||||
},
|
||||
"dotnet": {
|
||||
"target": "project"
|
||||
},
|
||||
"Microsoft.DotNet.Cli.Utils": {
|
||||
"target": "project",
|
||||
"type": "build"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue