2016-03-31 23:37:40 +00:00
|
|
|
|
// 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;
|
2016-04-01 00:27:13 +00:00
|
|
|
|
using System.Collections.Generic;
|
2016-03-31 23:37:40 +00:00
|
|
|
|
using Microsoft.DotNet.Cli.Utils;
|
2016-04-01 20:41:13 +00:00
|
|
|
|
using Microsoft.DotNet.Cli;
|
2016-03-31 23:37:40 +00:00
|
|
|
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
|
|
|
|
using Xunit;
|
|
|
|
|
using FluentAssertions;
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Tests
|
|
|
|
|
{
|
|
|
|
|
public class MockTelemetry : ITelemetry
|
|
|
|
|
{
|
2016-04-27 23:04:26 +00:00
|
|
|
|
public bool Enabled { get; set; }
|
|
|
|
|
|
|
|
|
|
public string EventName { get; set; }
|
|
|
|
|
|
2016-03-31 23:37:40 +00:00
|
|
|
|
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" };
|
2016-11-12 07:46:29 +00:00
|
|
|
|
Microsoft.DotNet.Cli.Program.ProcessArgs(args, mockTelemetry);
|
2016-03-31 23:37:40 +00:00
|
|
|
|
Assert.Equal(mockTelemetry.EventName, args[0]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|