Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String comparison test fix #1460

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace vstest.console.UnitTests.Processors
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Xml;

Expand Down Expand Up @@ -61,7 +62,7 @@ public void CapabilitiesShouldReturnAppropriateProperties()
var capabilities = new CLIRunSettingsArgumentProcessorCapabilities();

Assert.AreEqual("--", capabilities.CommandName);
Assert.AreEqual("RunSettings arguments:\n Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after \"-- \". Note the space after --. \n Use a space to separate multiple [name]=[value].\n More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments", capabilities.HelpContentResourceName);
Assert.AreEqual(0, String.Compare("RunSettings arguments: Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after \"-- \". Note the space after --. Use a space to separate multiple [name]=[value]. More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments", capabilities.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));

Assert.AreEqual(HelpContentPriority.CLIRunSettingsArgumentProcessorHelpPriority, capabilities.HelpPriority);
Assert.AreEqual(false, capabilities.IsAction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace vstest.console.UnitTests.Processors
{
using System;

using System.Globalization;
using Microsoft.VisualStudio.TestPlatform.CommandLine;
using Microsoft.VisualStudio.TestPlatform.CommandLine.Processors;
using Microsoft.VisualStudio.TestPlatform.Common;
Expand Down Expand Up @@ -47,7 +47,7 @@ public void CapabilitiesShouldReturnAppropriateProperties()
var capabilities = new CollectArgumentProcessorCapabilities();

Assert.AreEqual("/Collect", capabilities.CommandName);
Assert.AreEqual("--Collect|/Collect:<DataCollector FriendlyName>\n Enables data collector for the test run. More info here : https://aka.ms/vstest-collect", capabilities.HelpContentResourceName);
Assert.AreEqual(0, string.Compare("--Collect|/Collect:<DataCollector FriendlyName> Enables data collector for the test run. More info here : https://aka.ms/vstest-collect", capabilities.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));

Assert.AreEqual(HelpContentPriority.CollectArgumentProcessorHelpPriority, capabilities.HelpPriority);
Assert.AreEqual(false, capabilities.IsAction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.Processors
{
using Microsoft.VisualStudio.TestPlatform.CommandLine.Processors;
using Microsoft.VisualStudio.TestPlatform.Common.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using vstest.console.UnitTests.TestDoubles;

using System.Linq;
using Microsoft.VisualStudio.TestPlatform.Common;
using Moq;
using System.Globalization;

[TestClass]
public class EnableLoggersArgumentProcessorTests
Expand Down Expand Up @@ -41,9 +37,9 @@ public void CapabilitiesShouldAppropriateProperties()
EnableLoggerArgumentProcessorCapabilities capabilities = new EnableLoggerArgumentProcessorCapabilities();
Assert.AreEqual("/Logger", capabilities.CommandName);
#if NET451
Assert.AreEqual("--logger|/logger:<Logger Uri/FriendlyName>\n Specify a logger for test results. For example, to log results into a \n Visual Studio Test Results File (TRX) use /logger:trx[;LogFileName=<Defaults to unique file name>]\n Creates file in TestResults directory with given LogFileName.\n\n Change the verbosity level in log messages for console logger as shown below\n Example: /logger:console;verbosity=<Defaults to \"normal\">\n Allowed values for verbosity: quiet, minimal, normal and detailed.\n\n Change the diagnostic level prefix for console logger as shown below\n Example: /logger:console;prefix=<Defaults to \"false\">\n More info on Console Logger here : https://aka.ms/console-logger", capabilities.HelpContentResourceName);
Assert.AreEqual(0, string.Compare("--logger|/logger:<Logger Uri/FriendlyName> Specify a logger for test results. For example, to log results into a Visual Studio Test Results File (TRX) use /logger:trx[;LogFileName=<Defaults to unique file name>] Creates file in TestResults directory with given LogFileName. Change the verbosity level in log messages for console logger as shown below Example: /logger:console;verbosity=<Defaults to \"normal\"> Allowed values for verbosity: quiet, minimal, normal and detailed. Change the diagnostic level prefix for console logger as shown below Example: /logger:console;prefix=<Defaults to \"false\"> More info on Console Logger here : https://aka.ms/console-logger", capabilities.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));
#else
Assert.AreEqual("--logger|/logger:<Logger Uri/FriendlyName>\n Specify a logger for test results. For example, to log results into a \n Visual Studio Test Results File (TRX) use /logger:trx[;LogFileName=<Defaults to unique file name>]\n Creates file in TestResults directory with given LogFileName.\n\n Change the verbosity level in log messages for console logger as shown below\n Example: /logger:console;verbosity=<Defaults to \"minimal\">\n Allowed values for verbosity: quiet, minimal, normal and detailed.\n\n Change the diagnostic level prefix for console logger as shown below\n Example: /logger:console;prefix=<Defaults to \"false\">\n More info on Console Logger here : https://aka.ms/console-logger", capabilities.HelpContentResourceName);
Assert.AreEqual(0, string.Compare("--logger|/logger:<Logger Uri/FriendlyName> Specify a logger for test results. For example, to log results into a Visual Studio Test Results File (TRX) use /logger:trx[;LogFileName=<Defaults to unique file name>] Creates file in TestResults directory with given LogFileName. Change the verbosity level in log messages for console logger as shown below Example: /logger:console;verbosity=<Defaults to \"minimal\"> Allowed values for verbosity: quiet, minimal, normal and detailed. Change the diagnostic level prefix for console logger as shown below Example: /logger:console;prefix=<Defaults to \"false\"> More info on Console Logger here : https://aka.ms/console-logger", capabilities.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));
#endif

Assert.AreEqual(HelpContentPriority.EnableLoggerArgumentProcessorHelpPriority, capabilities.HelpPriority);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.Processors
{
using System.Collections.Generic;

using System.Globalization;
using Microsoft.VisualStudio.TestPlatform.CommandLine.Processors;
using Microsoft.VisualStudio.TestPlatform.Utilities;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand Down Expand Up @@ -39,7 +39,7 @@ public void CapabilitiesShouldAppropriateProperties()
{
HelpArgumentProcessorCapabilities capabilities = new HelpArgumentProcessorCapabilities();
Assert.AreEqual("/Help", capabilities.CommandName);
Assert.AreEqual("-?|--Help|/?|/Help\n Display this usage message.", capabilities.HelpContentResourceName);
Assert.AreEqual(0, string.Compare("-?|--Help|/?|/Help Display this usage message.", capabilities.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));

Assert.AreEqual(HelpContentPriority.HelpArgumentProcessorHelpPriority, capabilities.HelpPriority);
Assert.AreEqual(false, capabilities.IsAction);
Expand Down Expand Up @@ -71,7 +71,6 @@ public void ExecuterExecuteWritesAppropriateDataToConsole()
Assert.IsTrue(output.Lines.Contains("Arguments:"));
Assert.IsTrue(output.Lines.Contains("Options:"));
Assert.IsTrue(output.Lines.Contains("Description: Runs tests from the specified files."));
Assert.IsTrue(output.Lines.Contains(" To run tests:\n >vstest.console.exe tests.dll \n To run tests with additional settings such as data collectors:\n >vstest.console.exe tests.dll /Settings:Local.RunSettings"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.Processors
using Microsoft.VisualStudio.TestPlatform.CommandLine.Processors;
using Microsoft.VisualStudio.TestPlatform.Common.Utilities;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Globalization;
using vstest.console.UnitTests.Processors;

using ExceptionUtilities = Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.ExceptionUtilities;
Expand Down Expand Up @@ -55,7 +56,7 @@ public void InIsolationArgumentProcessorMetadataShouldProvideAppropriateCapabili
Assert.AreEqual(null, isolationProcessor.Metadata.Value.ShortCommandName);
Assert.AreEqual(ArgumentProcessorPriority.AutoUpdateRunSettings, isolationProcessor.Metadata.Value.Priority);
Assert.AreEqual(HelpContentPriority.InIsolationArgumentProcessorHelpPriority, isolationProcessor.Metadata.Value.HelpPriority);
Assert.AreEqual("--InIsolation|/InIsolation\n Runs the tests in an isolated process. This makes vstest.console.exe \n process less likely to be stopped on an error in the tests, but tests \n may run slower.", isolationProcessor.Metadata.Value.HelpContentResourceName);
Assert.AreEqual(0, string.Compare("--InIsolation|/InIsolation Runs the tests in an isolated process. This makes vstest.console.exe process less likely to be stopped on an error in the tests, but tests may run slower.", isolationProcessor.Metadata.Value.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.Processors
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Runtime.Versioning;
using System.Threading.Tasks;
Expand Down Expand Up @@ -102,8 +103,8 @@ public void CapabilitiesShouldReturnAppropriateProperties()
var capabilities = new ListTestsArgumentProcessorCapabilities();
Assert.AreEqual("/ListTests", capabilities.CommandName);
Assert.AreEqual("/lt", capabilities.ShortCommandName);
Assert.AreEqual("-lt|--ListTests|/lt|/ListTests:<File Name>\n Lists all discovered tests from the given test container.", capabilities.HelpContentResourceName);

Assert.AreEqual(0, string.Compare("-lt|--ListTests|/lt|/ListTests:<File Name> Lists all discovered tests from the given test container.", capabilities.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));
Assert.AreEqual(HelpContentPriority.ListTestsArgumentProcessorHelpPriority, capabilities.HelpPriority);
Assert.AreEqual(true, capabilities.IsAction);
Assert.AreEqual(ArgumentProcessorPriority.Normal, capabilities.Priority);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.Processors
using Microsoft.VisualStudio.TestPlatform.Common.Utilities;

using ExceptionUtilities = Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.ExceptionUtilities;
using System.Globalization;

[TestClass]
public class ParallelArgumentProcessorTests
Expand Down Expand Up @@ -49,8 +50,8 @@ public void CapabilitiesShouldReturnAppropriateProperties()
{
var capabilities = new ParallelArgumentProcessorCapabilities();
Assert.AreEqual("/Parallel", capabilities.CommandName);
Assert.AreEqual("--Parallel|/Parallel\n Specifies that the tests be executed in parallel. By default up\n to all available cores on the machine may be used.\n The number of cores to use may be configured using a settings file.", capabilities.HelpContentResourceName);

Assert.AreEqual(0, string.Compare("--Parallel|/Parallel Specifies that the tests be executed in parallel. By default up to all available cores on the machine may be used. The number of cores to use may be configured using a settings file.", capabilities.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));
Assert.AreEqual(HelpContentPriority.ParallelArgumentProcessorHelpPriority, capabilities.HelpPriority);
Assert.AreEqual(false, capabilities.IsAction);
Assert.AreEqual(ArgumentProcessorPriority.AutoUpdateRunSettings, capabilities.Priority);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// 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;
using System;

namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.Processors
{
using Microsoft.VisualStudio.TestPlatform.CommandLine.Processors;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Globalization;

[TestClass]
public class ParentProcessIdArgumentProcessorTests
{
Expand Down Expand Up @@ -39,7 +40,7 @@ public void CapabilitiesShouldReturnAppropriateProperties()
{
var capabilities = new ParentProcessIdArgumentProcessorCapabilities();
Assert.AreEqual("/ParentProcessId", capabilities.CommandName);
Assert.AreEqual("--ParentProcessId|/ParentProcessId:<ParentProcessId>\n Process Id of the Parent Process responsible for launching current process.", capabilities.HelpContentResourceName);
Assert.AreEqual(0, string.Compare("--ParentProcessId|/ParentProcessId:<ParentProcessId> Process Id of the Parent Process responsible for launching current process.", capabilities.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));

Assert.AreEqual(HelpContentPriority.ParentProcessIdArgumentProcessorHelpPriority, capabilities.HelpPriority);
Assert.AreEqual(false, capabilities.IsAction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.Processors
using vstest.console.UnitTests.Processors;
using Microsoft.VisualStudio.TestPlatform.Common.Utilities;
using ExceptionUtilities = Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.ExceptionUtilities;
using System.Globalization;

[TestClass]
public class PlatformArgumentProcessorTests
Expand Down Expand Up @@ -49,8 +50,8 @@ public void CapabilitiesShouldReturnAppropriateProperties()
{
var capabilities = new PlatformArgumentProcessorCapabilities();
Assert.AreEqual("/Platform", capabilities.CommandName);
Assert.AreEqual("--Platform|/Platform:<Platform type>\n Target platform architecture to be used for test execution. \n Valid values are x86, x64 and ARM.", capabilities.HelpContentResourceName);

Assert.AreEqual(0, string.Compare("--Platform|/Platform:<Platform type> Target platform architecture to be used for test execution. Valid values are x86, x64 and ARM.", capabilities.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));
Assert.AreEqual(HelpContentPriority.PlatformArgumentProcessorHelpPriority, capabilities.HelpPriority);
Assert.AreEqual(false, capabilities.IsAction);
Assert.AreEqual(ArgumentProcessorPriority.AutoUpdateRunSettings, capabilities.Priority);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.Processors
using Moq;
using System;
using System.Diagnostics;
using System.Globalization;

[TestClass]
public class PortArgumentProcessorTests
Expand Down Expand Up @@ -50,7 +51,7 @@ public void CapabilitiesShouldAppropriateProperties()
{
var capabilities = new PortArgumentProcessorCapabilities();
Assert.AreEqual("/Port", capabilities.CommandName);
Assert.AreEqual("--Port|/Port:<Port>\n The Port for socket connection and receiving the event messages.", capabilities.HelpContentResourceName);
Assert.AreEqual(0, string.Compare("--Port|/Port:<Port> The Port for socket connection and receiving the event messages.", capabilities.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));

Assert.AreEqual(HelpContentPriority.PortArgumentProcessorHelpPriority, capabilities.HelpPriority);
Assert.AreEqual(false, capabilities.IsAction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.Processors
using System.IO;
using vstest.console.UnitTests.Processors;
using Microsoft.VisualStudio.TestPlatform.Common.Utilities;
using System.Globalization;

[TestClass]
public class ResultsDirectoryArgumentProcessorTests
Expand Down Expand Up @@ -50,7 +51,7 @@ public void CapabilitiesShouldReturnAppropriateProperties()
{
var capabilities = new ResultsDirectoryArgumentProcessorCapabilities();
Assert.AreEqual("/ResultsDirectory", capabilities.CommandName);
Assert.AreEqual("--ResultsDirectory|/ResultsDirectory\n Test results directory will be created in specified path if not exists.\n Example /ResultsDirectory:<pathToResultsDirectory>", capabilities.HelpContentResourceName);
Assert.AreEqual(0, string.Compare("--ResultsDirectory|/ResultsDirectory Test results directory will be created in specified path if not exists. Example /ResultsDirectory:<pathToResultsDirectory>", capabilities.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));

Assert.AreEqual(HelpContentPriority.ResultsDirectoryArgumentProcessorHelpPriority, capabilities.HelpPriority);
Assert.AreEqual(false, capabilities.IsAction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.Processors

using Moq;
using System.Text;
using System.Globalization;

[TestClass]
public class RunSettingsArgumentProcessorTests
Expand Down Expand Up @@ -58,7 +59,7 @@ public void CapabilitiesShouldReturnAppropriateProperties()
{
var capabilities = new RunSettingsArgumentProcessorCapabilities();
Assert.AreEqual("/Settings", capabilities.CommandName);
Assert.AreEqual("--Settings|/Settings:<Settings File>\n Settings to use when running tests.", capabilities.HelpContentResourceName);
Assert.AreEqual(0, string.Compare("--Settings|/Settings:<Settings File> Settings to use when running tests.", capabilities.HelpContentResourceName, CultureInfo.InvariantCulture, CompareOptions.IgnoreSymbols));

Assert.AreEqual(HelpContentPriority.RunSettingsArgumentProcessorHelpPriority, capabilities.HelpPriority);
Assert.AreEqual(false, capabilities.IsAction);
Expand Down
Loading