-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
dotnet vstest
deprecation message (#4297)
- Loading branch information
1 parent
4cf1986
commit 6f859cb
Showing
21 changed files
with
211 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/vstest.console/Processors/ShowDeprecateDotnetVStestMessageArgumentProcessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Linq; | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.CommandLine.Processors; | ||
internal class ShowDeprecateDotnetVStestMessageArgumentProcessor : IArgumentProcessor | ||
{ | ||
public const string CommandName = "/ShowDeprecateDotnetVSTestMessage"; | ||
private Lazy<IArgumentProcessorCapabilities>? _metadata; | ||
private Lazy<IArgumentExecutor>? _executor; | ||
|
||
public Lazy<IArgumentExecutor>? Executor | ||
{ | ||
get => _executor ??= new Lazy<IArgumentExecutor>(() => | ||
new ShowDeprecateDotnetVStestMessageProcessorExecutor()); | ||
|
||
set => _executor = value; | ||
} | ||
|
||
public Lazy<IArgumentProcessorCapabilities> Metadata | ||
=> _metadata ??= new Lazy<IArgumentProcessorCapabilities>(() => new ShowDeprecateDotnetVStestMessageProcessorCapabilities()); | ||
|
||
public static bool ContainsShowDeprecateDotnetVSTestMessageCommand(string[]? args) => | ||
args?.Contains("--ShowDeprecateDotnetVSTestMessage", StringComparer.OrdinalIgnoreCase) == true; | ||
} | ||
|
||
internal class ShowDeprecateDotnetVStestMessageProcessorCapabilities : BaseArgumentProcessorCapabilities | ||
{ | ||
public override string CommandName => ShowDeprecateDotnetVStestMessageArgumentProcessor.CommandName; | ||
|
||
public override bool AllowMultiple => false; | ||
|
||
public override ArgumentProcessorPriority Priority => ArgumentProcessorPriority.CliRunSettings; | ||
|
||
public override HelpContentPriority HelpPriority => HelpContentPriority.None; | ||
|
||
public override string? HelpContentResourceName => null; | ||
} | ||
|
||
internal class ShowDeprecateDotnetVStestMessageProcessorExecutor : IArgumentExecutor | ||
{ | ||
public ArgumentProcessorResult Execute() => ArgumentProcessorResult.Success; | ||
|
||
public void Initialize(string? argument) { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...st.console.UnitTests/Processors/ShowDeprecateDotnetVStestMessageArgumentProcessorTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using Microsoft.VisualStudio.TestPlatform.CommandLine.Processors; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace vstest.console.UnitTests.Processors; | ||
|
||
[TestClass] | ||
[TestCategory("Windows-Review")] | ||
public class ShowDeprecateDotnetVStestMessageArgumentProcessorTests | ||
{ | ||
[TestMethod] | ||
public void ShowDeprecateDotnetVStestMessageProcessorCommandName() | ||
{ | ||
Assert.AreEqual("/ShowDeprecateDotnetVSTestMessage", ShowDeprecateDotnetVStestMessageArgumentProcessor.CommandName); | ||
} | ||
|
||
[TestMethod] | ||
public void ShowDeprecateDotnetVStestMessageProcessorCapabilities() | ||
{ | ||
ShowDeprecateDotnetVStestMessageProcessorCapabilities showDeprecateDotnetVStestMessageProcessorCapabilities = new(); | ||
Assert.IsNull(showDeprecateDotnetVStestMessageProcessorCapabilities.HelpContentResourceName); | ||
Assert.IsFalse(showDeprecateDotnetVStestMessageProcessorCapabilities.IsAction); | ||
Assert.IsFalse(showDeprecateDotnetVStestMessageProcessorCapabilities.AllowMultiple); | ||
Assert.AreEqual(ArgumentProcessorPriority.CliRunSettings, showDeprecateDotnetVStestMessageProcessorCapabilities.Priority); | ||
Assert.AreEqual(HelpContentPriority.None, showDeprecateDotnetVStestMessageProcessorCapabilities.HelpPriority); | ||
} | ||
|
||
[TestMethod] | ||
public void ShowDeprecateDotnetVStestMessageArgumentProcessorReturnsCorrectTypes() | ||
{ | ||
ShowDeprecateDotnetVStestMessageArgumentProcessor showDeprecateDotnetVStestMessageArgumentProcessor = new(); | ||
Assert.IsInstanceOfType(showDeprecateDotnetVStestMessageArgumentProcessor.Executor!.Value, typeof(ShowDeprecateDotnetVStestMessageProcessorExecutor)); | ||
Assert.IsInstanceOfType(showDeprecateDotnetVStestMessageArgumentProcessor.Metadata!.Value, typeof(ShowDeprecateDotnetVStestMessageProcessorCapabilities)); | ||
} | ||
|
||
|
||
[TestMethod] | ||
public void ShowDeprecateDotnetVStestMessageProcessorExecutor_Succeded() | ||
{ | ||
ShowDeprecateDotnetVStestMessageProcessorExecutor showDeprecateDotnetVStestMessageProcessorExecutor = new(); | ||
showDeprecateDotnetVStestMessageProcessorExecutor.Initialize("we will ignore the param"); | ||
Assert.AreEqual(ArgumentProcessorResult.Success, showDeprecateDotnetVStestMessageProcessorExecutor.Execute()); | ||
} | ||
} |