From 7759488cb85ef36c7ba4cd6102b842c4bfa2264b Mon Sep 17 00:00:00 2001 From: Maximilian Chaplin Date: Fri, 21 Feb 2020 13:24:08 +0100 Subject: [PATCH 1/3] Convention, spelling & grammar fixes. --- .../Program.cs | 4 +-- .../CollectorNameValueConfigurationManager.cs | 2 +- .../EventLogDataCollector.cs | 2 +- .../EventLogSessionContext.cs | 2 +- .../TraceDataCollector/ProcessJobObject.cs | 4 +-- .../DynamicCoverageDataCollector.cs | 2 +- .../DynamicCoverageDataCollectorImpl.cs | 2 +- .../VanguardCollector/Vanguard.cs | 16 ++++----- .../DesignModeTestEventsRegistrar.cs | 6 ++-- .../Discovery/DiscoveryRequest.cs | 4 +-- .../Execution/TestRunRequest.cs | 16 ++++----- .../RequestHelper/ITestRequestManager.cs | 2 +- .../TestPlatform.cs | 2 +- .../DataCollectionAttachmentManager.cs | 2 +- .../DataCollection/DataCollectionManager.cs | 4 +-- .../IDataCollectionAttachmentManager.cs | 2 +- .../Interfaces/IDataCollectionManager.cs | 4 +-- .../TestPlatformDataCollectionEvents.cs | 6 ++-- .../TestPlatformDataCollectionLogger.cs | 2 +- .../TestDiscoveryExtensionManager.cs | 2 +- .../TestExecutorExtensionManager.cs | 4 +-- .../ExtensionFramework/TestPluginCache.cs | 6 ++-- .../TestPluginDiscoverer.cs | 6 ++-- .../TestExtensionPluginInformation.cs | 2 +- .../Filtering/Condition.cs | 6 ++-- .../Filtering/FilterExpression.cs | 6 ++-- .../IParallelProxyExecutionManager.cs | 2 +- .../TesthostProtocol/IExecutionManager.cs | 4 +-- .../Logging/InternalTestLoggerEvents.cs | 36 +++++++++---------- .../Resources/Resources.Designer.cs | 2 +- .../Resources/Resources.resx | 2 +- .../Resources/xlf/Resources.cs.xlf | 2 +- .../Resources/xlf/Resources.de.xlf | 2 +- .../Resources/xlf/Resources.es.xlf | 2 +- .../Resources/xlf/Resources.fr.xlf | 2 +- .../Resources/xlf/Resources.it.xlf | 2 +- .../Resources/xlf/Resources.ja.xlf | 2 +- .../Resources/xlf/Resources.ko.xlf | 2 +- .../Resources/xlf/Resources.pl.xlf | 2 +- .../Resources/xlf/Resources.pt-BR.xlf | 2 +- .../Resources/xlf/Resources.ru.xlf | 2 +- .../Resources/xlf/Resources.tr.xlf | 2 +- .../Resources/xlf/Resources.xlf | 4 +-- .../Resources/xlf/Resources.zh-Hans.xlf | 2 +- .../Resources/xlf/Resources.zh-Hant.xlf | 2 +- .../RunSettings.cs | 2 +- .../SettingsProviderExtensionManager.cs | 2 +- .../Utilities/AssemblyResolver.cs | 2 +- .../Utilities/CancellationTokenExtensions.cs | 2 +- .../Utilities/FakesUtilities.cs | 2 +- .../RunSettingsProviderExtensions.cs | 2 +- .../DataCollectionRequestHandler.cs | 12 +++---- .../DataCollectionTestCaseEventSender.cs | 2 +- .../IDataCollectionRequestSender.cs | 2 +- .../IDataCollectionTestCaseEventHandler.cs | 4 +-- .../Interfaces/ITestRequestHandler.cs | 2 +- .../ObjectModel/TestRunCriteriaWithSources.cs | 2 +- .../ObjectModel/TestRunCriteriaWithTests.cs | 2 +- .../SocketClient.cs | 2 +- .../SocketCommunicationManager.cs | 2 +- .../SocketServer.cs | 2 +- .../TestRequestSender.cs | 4 +-- .../Tracing/EqtTrace.cs | 2 +- .../Utilities/JobQueue.cs | 2 +- .../ValidateArg.cs | 2 +- .../Adapter/RunContext.cs | 2 +- .../LoggerNameValueConfigurationManager.cs | 2 +- .../ParallelDiscoveryDataAggregator.cs | 2 +- .../Parallel/ParallelOperationManager.cs | 4 +-- .../Parallel/ParallelProxyExecutionManager.cs | 4 +-- .../Client/ProxyOperationManager.cs | 8 ++--- .../Client/TestLoggerManager.cs | 4 +-- .../Constants.cs | 2 +- .../DataCollectionTestRunEventsHandler.cs | 2 +- .../InProcDataCollectionExtensionManager.cs | 28 +++++++-------- .../InProcDataCollectionSink.cs | 2 +- .../DataCollection/InProcDataCollector.cs | 6 ++-- .../ParallelDataCollectionEventsHandler.cs | 2 +- .../ProxyDataCollectionManager.cs | 4 +-- .../Discovery/DiscovererEnumerator.cs | 14 ++++---- .../EventHandlers/TestRequestHandler.cs | 2 +- .../Execution/BaseRunTests.cs | 8 ++--- .../Execution/ExecutionManager.cs | 6 ++-- .../Execution/TestRunCache.cs | 2 +- .../TestEngine.cs | 4 +-- .../BlameCollector.cs | 4 +-- .../Constants.cs | 4 +-- .../Interfaces/IProcessDumpUtility.cs | 4 +-- .../ProcessDumpUtility.cs | 14 ++++---- .../Interfaces/XmlTestStoreParameters.cs | 2 +- .../ObjectModel/TestCategoryItems.cs | 4 +-- .../ObjectModel/TestRunSummary.cs | 36 +++++++++---------- .../TrxLogger.cs | 10 +++--- .../Utility/Converter.cs | 8 ++--- .../Utility/FileHelper.cs | 2 +- .../XML/Attributes.cs | 10 +++--- .../XML/XmlPersistence.cs | 6 ++-- .../Adapter/TestPlatformFormatException.cs | 2 +- .../Adapter/TestsCanceledException.cs | 2 +- .../AttachmentSet.cs | 2 +- .../Client/Events/TestRunCompleteEventArgs.cs | 2 +- .../Client/TestRunState.cs | 2 +- .../TestRunnerConnectionInfo.cs | 6 ++-- .../Constants.cs | 4 +-- .../DataCollector/Common/FileHelper.cs | 2 +- .../Common/TestCaseFailureType.cs | 2 +- .../DataCollector/DataCollectionContext.cs | 2 +- .../Events/DataCollectionEventArgs.cs | 2 +- .../DataCollector/Events/SessionEvents.cs | 16 ++++----- .../DataCollector/Events/TestCaseEvents.cs | 34 +++++++++--------- .../ExceptionConverter.cs | 6 ++-- .../Host/ITestRunTimeProvider.cs | 6 ++-- .../Logger/LoggerSettings.cs | 2 +- .../Events/DataCollectionMessageEventArgs.cs | 10 +++--- .../Navigation/DiaNavigationData.cs | 2 +- .../Navigation/FullSymbolReader.cs | 6 ++-- .../Navigation/ISymbolReader.cs | 2 +- .../Navigation/PortablePdbReader.cs | 4 +-- .../RunSettings/RunConfiguration.cs | 2 +- .../RunSettings/SettingsException.cs | 2 +- .../TestObject.cs | 6 ++-- .../Utilities/AssemblyHelper.cs | 10 +++--- .../Utilities/AssemblyLoadWorker.cs | 12 +++---- .../Utilities/EqtHash.cs | 2 +- .../Utilities/FilterHelper.cs | 4 +-- .../Utilities/SuspendCodeCoverage.cs | 4 +-- .../Interfaces/IO/IStream.cs | 4 +-- .../Interfaces/Tracing/IPlatformEqtTrace.cs | 6 ++-- .../common/Tracing/PlatformEqtTrace.cs | 4 +-- .../Tracing/RollingFileTraceListener.cs | 4 +-- .../Hosting/AppxManifestFile.cs | 2 +- .../Hosting/DefaultTestHostManager.cs | 6 ++-- .../Hosting/DotnetTestHostManager.cs | 14 ++++---- .../ClientUtilities.cs | 2 +- .../InferRunSettingsHelper.cs | 8 ++--- .../ParallelRunSettingsUtilities.cs | 4 +-- .../XmlUtilities.cs | 2 +- .../VsTestConsoleProcessManager.cs | 2 +- .../VsTestConsoleRequestSender.cs | 8 ++--- .../VsTestConsoleWrapper.cs | 2 +- src/SettingsMigrator/Program.cs | 2 +- src/datacollector/Program.cs | 2 +- src/testhost.x86/AppDomainEngineInvoker.cs | 4 +-- src/testhost.x86/DefaultEngineInvoker.cs | 4 +-- src/testhost.x86/Program.cs | 2 +- .../CommandLine/AssemblyMetadataProvider.cs | 8 ++--- .../CommandLine/CommandArgumentPair.cs | 4 +-- .../CommandLine/CommandLineOptions.cs | 2 +- src/vstest.console/CommandLine/Executor.cs | 10 +++--- src/vstest.console/CommandLine/InferHelper.cs | 4 +-- src/vstest.console/Internal/ConsoleLogger.cs | 2 +- .../Internal/FilePatternParser.cs | 6 ++-- .../Processors/CollectArgumentProcessor.cs | 16 ++++----- .../EnableCodeCoverageArgumentProcessor.cs | 2 +- .../Processors/HelpArgumentProcessor.cs | 6 ++-- .../InIsolationArgumentProcessor.cs | 2 +- .../IArgumentProcessorCapabilities.cs | 2 +- ...istFullyQualifiedTestsArgumentProcessor.cs | 6 ++-- .../RunSpecificTestsArgumentProcessor.cs | 4 +-- .../Processors/RunTestsArgumentProcessor.cs | 2 +- .../Utilities/ArgumentProcessorUtilities.cs | 2 +- .../Publisher/MetricsPublisherFactory.cs | 2 +- .../TestPlatformHelpers/TestRequestManager.cs | 10 +++--- .../CodeCoverageTests.cs | 6 ++-- .../RunsettingsTests.cs | 6 ++-- .../TelemetryTests.cs | 2 +- .../TranslationLayerTests/RunTests.cs | 4 +-- ...RunTestsWithDifferentConfigurationTests.cs | 2 +- .../Execution/TestRunRequestTests.cs | 2 +- .../TestPluginCacheTests.cs | 2 +- .../TestPluginDiscovererTests.cs | 2 +- .../Filtering/FastFilterTests.cs | 2 +- .../Hosting/TestHostProviderManagerTests.cs | 2 +- .../Logging/InternalTestLoggerEventsTests.cs | 4 +-- .../Output/OutputExtensionsTests.cs | 2 +- .../Utilities/JobQueueTests.cs | 6 ++-- .../InProcessProxyDiscoveryManagerTests.cs | 2 +- .../Parallel/ParallelOperationManagerTests.cs | 2 +- .../ParallelProxyDiscoveryManagerTests.cs | 2 +- .../ParallelRunDataAggregatorTests.cs | 4 +-- .../Client/ProxyExecutionManagerTests.cs | 2 +- ...ExecutionManagerWithDataCollectionTests.cs | 2 +- .../Client/ProxyOperationManagerTests.cs | 6 ++-- .../Discovery/DiscovererEnumeratorTests.cs | 4 +-- .../Execution/RunTestsWithSourcesTests.cs | 2 +- .../Execution/RunTestsWithTestsTests.cs | 2 +- .../BlameCollectorTests.cs | 2 +- .../ProcessDumpUtilityTests.cs | 8 ++--- .../DiaSessionTests.cs | 2 +- .../Utilities/XmlRunSettingsUtilitiesTests.cs | 2 +- .../TranslationLayer/TelemetryPerfTestBase.cs | 2 +- .../Hosting/DotnetTestHostManagerTests.cs | 2 +- .../IntegrationTestBase.cs | 8 ++--- .../PerfInstrumentation/PerfAnalyzer.cs | 2 +- .../PerformanceTestBase.cs | 2 +- .../XmlUtilitiesTests.cs | 2 +- .../CoverletInProcDataCollector.cs | 2 +- .../VsTestConsoleRequestSenderTests.cs | 2 +- test/testhost.UnitTests/DummyTests.cs | 2 +- .../AssemblyMetadataProviderTests.cs | 2 +- .../ExecutorUnitTests.cs | 2 +- ...nableCodeCoverageArgumentProcessorTests.cs | 2 +- .../RunSpecificTestsArgumentProcessorTests.cs | 2 +- 203 files changed, 452 insertions(+), 452 deletions(-) diff --git a/samples/Microsoft.TestPlatform.Protocol/Program.cs b/samples/Microsoft.TestPlatform.Protocol/Program.cs index 75d78d72eb..63b6f03cbd 100644 --- a/samples/Microsoft.TestPlatform.Protocol/Program.cs +++ b/samples/Microsoft.TestPlatform.Protocol/Program.cs @@ -97,7 +97,7 @@ public static int Main(string[] args) "; } - // Intialize the extensions + // Initialize the extensions if (testadapterPath != null) { communicationManager.SendMessage(MessageType.ExtensionsInitialize, new List() { testadapterPath }); @@ -262,7 +262,7 @@ static void RecieveRunMesagesAndHandleRunComplete() { var testProcessStartInfo = dataSerializer.DeserializePayload(message); - // Launch Test Host here and Send the acknowledgement + // Launch Test Host here and Send the acknowledgment var ackPayload = new CustomHostLaunchAckPayload() { HostProcessId = -1, ErrorMessage = null }; Process process = new Process(); diff --git a/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/CollectorNameValueConfigurationManager.cs b/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/CollectorNameValueConfigurationManager.cs index 5358acd119..ff34fba34d 100644 --- a/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/CollectorNameValueConfigurationManager.cs +++ b/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/CollectorNameValueConfigurationManager.cs @@ -83,7 +83,7 @@ public CollectorNameValueConfigurationManager(XmlElement configurationElement) } // Save the name/value pair in the dictionary. Note that duplicate settings are - // overwritten with the last occurrance's value. + // overwritten with the last occurrence's value. if (this.nameValuePairs.ContainsKey(settingName)) { if (EqtTrace.IsVerboseEnabled) diff --git a/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogDataCollector.cs b/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogDataCollector.cs index fdad5edbbb..9291da0111 100644 --- a/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogDataCollector.cs +++ b/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogDataCollector.cs @@ -354,7 +354,7 @@ internal string WriteEventLogs(List eventLogEntries, int maxLogEn /// /// Cleans up resources allocated by the data collector /// - /// Not used since this class does not have a finaliser. + /// Not used since this class does not have a finalizer. protected override void Dispose(bool disposing) { // Unregister events diff --git a/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogSessionContext.cs b/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogSessionContext.cs index c9ff9a3baf..059975eea7 100644 --- a/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogSessionContext.cs +++ b/src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogSessionContext.cs @@ -6,7 +6,7 @@ namespace Microsoft.TestPlatform.Extensions.EventLogCollector using System.Collections.Generic; /// - /// Stores the start and end index for EventLogEntries correspoinding to a data collection session. + /// Stores the start and end index for EventLogEntries corresponding to a data collection session. /// internal class EventLogSessionContext { diff --git a/src/DataCollectors/TraceDataCollector/ProcessJobObject.cs b/src/DataCollectors/TraceDataCollector/ProcessJobObject.cs index 680d3bee94..b44164204a 100644 --- a/src/DataCollectors/TraceDataCollector/ProcessJobObject.cs +++ b/src/DataCollectors/TraceDataCollector/ProcessJobObject.cs @@ -667,7 +667,7 @@ private struct ExtendedLimits32 public BasicLimits32 BasicLimits; /// - /// Resereved. + /// Reserved. /// [FieldOffset(48)] public IoCounters32 IoInfo; @@ -718,7 +718,7 @@ private struct ExtendedLimits64 public BasicLimits64 BasicLimits; /// - /// Resereved. + /// Reserved. /// [FieldOffset(64)] public IoCounters64 IoInfo; diff --git a/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollector.cs b/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollector.cs index a2dbaff626..1f0059b4b1 100644 --- a/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollector.cs +++ b/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollector.cs @@ -105,7 +105,7 @@ protected override void OnInitialize(XmlElement configurationElement) } catch (Exception ex) { - EqtTrace.Error("DynamicCoverageDataCollector.OnInitialize: Failed to initialize code coverage datacolector with exception: {0}", ex); + EqtTrace.Error("DynamicCoverageDataCollector.OnInitialize: Failed to initialize code coverage datacollector with exception: {0}", ex); this.Logger.LogError( this.AgentContext.SessionDataCollectionContext, string.Format(CultureInfo.CurrentUICulture, Resources.FailedToInitializeCodeCoverageDataCollector, ex)); diff --git a/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollectorImpl.cs b/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollectorImpl.cs index 01a55648da..bac2a03655 100644 --- a/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollectorImpl.cs +++ b/src/DataCollectors/TraceDataCollector/VanguardCollector/DynamicCoverageDataCollectorImpl.cs @@ -28,7 +28,7 @@ internal class DynamicCoverageDataCollectorImpl : IDynamicCoverageDataCollectorI private const string ConfigCodeCoverageElementName = "CodeCoverage"; /// - /// File name which conatins config for vanguard process. + /// File name which contains config for vanguard process. /// private const string VanguardConfigFileName = "CodeCoverage.config"; diff --git a/src/DataCollectors/TraceDataCollector/VanguardCollector/Vanguard.cs b/src/DataCollectors/TraceDataCollector/VanguardCollector/Vanguard.cs index 95f55c8ad6..f5319a61e0 100644 --- a/src/DataCollectors/TraceDataCollector/VanguardCollector/Vanguard.cs +++ b/src/DataCollectors/TraceDataCollector/VanguardCollector/Vanguard.cs @@ -28,7 +28,7 @@ internal class Vanguard : IVanguard private const uint WaitObject0 = 0x00000000; /// - /// Time limit for vangaurd process exit event + /// Time limit for vanguard process exit event /// private const int ProcessExitWaitLimit = 60000; @@ -38,7 +38,7 @@ internal class Vanguard : IVanguard private const string GlobalEventNamePrefix = "Global\\"; /// - /// Stop() will use this event to check wheather the stop vanguard commnad + /// Stop() will use this event to check whether the stop vanguard command /// successful stop the collect command codecoverage.exe. /// private ManualResetEvent vanguardProcessExitEvent; @@ -98,7 +98,7 @@ internal Vanguard( } /// - /// Gets a value indicating whether whether vanguard is running + /// Gets a value indicating whether vanguard is running /// private bool IsRunning { @@ -139,7 +139,7 @@ public virtual void Start(string outputName, DataCollectionContext context) /// public virtual void Stop() { - EqtTrace.Info("Vanguard.Stop: Stoping Vanguard."); + EqtTrace.Info("Vanguard.Stop: Stopping Vanguard."); if (this.IsRunning) { var shutdownCommand = this.vanguardCommandBuilder.GenerateCommandLine( @@ -151,7 +151,7 @@ public virtual void Stop() if (this.vanguardProcessExitEvent.WaitOne(ProcessExitWaitLimit) == false) { - EqtTrace.Warning("Vanguard.Stop: Vangurad process not exited in {0} ms", ProcessExitWaitLimit); + EqtTrace.Warning("Vanguard.Stop: Vanguard process not exited in {0} ms", ProcessExitWaitLimit); } if (this.processJobObject != null) @@ -275,12 +275,12 @@ private Process StartVanguardProcess( } else if (this.processJobObject != null) { - EqtTrace.Info("Vanguard.StartVanguardProcess: Add Vangaurd process to the project object"); + EqtTrace.Info("Vanguard.StartVanguardProcess: Add Vanguard process to the project object"); this.processJobObject.AddProcess(process.SafeHandle.DangerousGetHandle()); } EqtTrace.Info( - "Vanguard.StartVanguardProcess: Started Vangaurd process id :{0}", + "Vanguard.StartVanguardProcess: Started Vanguard process id :{0}", Vanguard.GetProcessId(process)); return process; @@ -340,7 +340,7 @@ private void WaitForRunningEvent() /// Event args. private void LoggerProcessExited(object sender, EventArgs e) { - EqtTrace.Info("Vanguard.LoggerProcessExited: Vangaurd process exit callback started."); + EqtTrace.Info("Vanguard.LoggerProcessExited: Vanguard process exit callback started."); if (this.vanguardProcess != null) { if (this.vanguardProcess.HasExited == true && this.vanguardProcess.ExitCode != 0) diff --git a/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeTestEventsRegistrar.cs b/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeTestEventsRegistrar.cs index 420daa9ed3..be33e0b96d 100644 --- a/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeTestEventsRegistrar.cs +++ b/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeTestEventsRegistrar.cs @@ -8,7 +8,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Client.DesignMode using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; /// - /// Registers the discovery and test run events for designmode flow + /// Registers the discovery and test run events for design mode flow /// public class DesignModeTestEventsRegistrar : ITestDiscoveryEventsRegistrar, ITestRunEventsRegistrar { @@ -54,10 +54,10 @@ public void UnregisterTestRunEvents(ITestRunRequest testRunRequest) /// RawMessage from the testhost private void OnRawMessageReceived(object sender, string rawMessage) { - // Directly send the data to translation layer instead of deserializing it here + // Directly send the data to translation layer instead of de-serializing it here this.designModeClient.SendRawMessage(rawMessage); } - + public void LogWarning(string message) { this.designModeClient.SendTestMessage(TestMessageLevel.Warning, message); diff --git a/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs b/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs index dcfda424d7..1a6ca24394 100644 --- a/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs +++ b/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs @@ -144,7 +144,7 @@ public void Abort() } /// - /// Wait for discovery completion completion + /// Wait for discovery completion /// /// The timeout. bool IRequest.WaitForCompletion(int timeout) @@ -265,7 +265,7 @@ public void HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryComplete try { // Raise onDiscoveredTests event if there are some tests in the last chunk. - // (We dont want to send the tests in the discovery complete event so that programming on top of + // (We don't want to send the tests in the discovery complete event so that programming on top of // RS client is easier i.e. user does not have to listen on discovery complete event.) if (lastChunk != null && lastChunk.Count() > 0) { diff --git a/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs b/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs index a58438532a..aac93dcafa 100644 --- a/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs +++ b/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs @@ -47,7 +47,7 @@ public class TestRunRequest : ITestRunRequest, ITestRunEventsHandler private object cancelSyncObject = new Object(); /// - /// The run completion event which will be signalled on completion of test run. + /// The run completion event which will be signaled on completion of test run. /// private ManualResetEvent runCompletionEvent = new ManualResetEvent(true); @@ -189,7 +189,7 @@ internal void OnTestSessionTimeout(object obj) { if (EqtTrace.IsVerboseEnabled) { - EqtTrace.Verbose(String.Format("TestRunRequest.OnTestSessionTimeout: calling cancelation as test run exceeded testSessionTimeout {0} milliseconds", testSessionTimeout)); + EqtTrace.Verbose(String.Format("TestRunRequest.OnTestSessionTimeout: calling cancellation as test run exceeded testSessionTimeout {0} milliseconds", testSessionTimeout)); } string message = String.Format(ClientResources.TestSessionTimeoutMessage, this.testSessionTimeout); @@ -260,7 +260,7 @@ public void CancelAsync() } } - EqtTrace.Info("TestRunRequest.CancelAsync: Cancelled."); + EqtTrace.Info("TestRunRequest.CancelAsync: Canceled."); } /// @@ -395,7 +395,7 @@ public void HandleTestRunComplete(TestRunCompleteEventArgs runCompleteArgs, Test lock (this.syncObject) { - // If this object is disposed, dont do anything + // If this object is disposed, don't do anything if (this.disposed) { EqtTrace.Warning("TestRunRequest.TestRunComplete: Ignoring as the object is disposed."); @@ -428,7 +428,7 @@ public void HandleTestRunComplete(TestRunCompleteEventArgs runCompleteArgs, Test runCompleteArgs.IsCanceled, runCompleteArgs.IsAborted, runCompleteArgs.Error, - // This is required as TMI adapter is sending attachments as List which cannot be typecasted to Collection. + // This is required as TMI adapter is sending attachments as List which cannot be type casted to Collection. runContextAttachments != null ? new Collection(runContextAttachments.ToList()) : null, this.runRequestTimeTracker.Elapsed); @@ -488,7 +488,7 @@ public virtual void HandleTestRunStatsChange(TestRunChangedEventArgs testRunChan EqtTrace.Verbose("TestRunRequest:SendTestRunStatsChange: Starting."); if (testRunChangedArgs.ActiveTests != null) { - // Do verbose check to save perf in iterating test cases + // Do verbose check to save performance in iterating test cases if (EqtTrace.IsVerboseEnabled) { foreach (TestCase testCase in testRunChangedArgs.ActiveTests) @@ -500,7 +500,7 @@ public virtual void HandleTestRunStatsChange(TestRunChangedEventArgs testRunChan lock (this.syncObject) { - // If this object is disposed, dont do anything + // If this object is disposed, don't do anything if (this.disposed) { EqtTrace.Warning("TestRunRequest.SendTestRunStatsChange: Ignoring as the object is disposed."); @@ -526,7 +526,7 @@ public void HandleLogMessage(TestMessageLevel level, string message) lock (this.syncObject) { - // If this object is disposed, dont do anything + // If this object is disposed, don't do anything if (this.disposed) { EqtTrace.Warning("TestRunRequest.SendTestRunMessage: Ignoring as the object is disposed."); diff --git a/src/Microsoft.TestPlatform.Client/RequestHelper/ITestRequestManager.cs b/src/Microsoft.TestPlatform.Client/RequestHelper/ITestRequestManager.cs index d23975afed..45e6a655f6 100644 --- a/src/Microsoft.TestPlatform.Client/RequestHelper/ITestRequestManager.cs +++ b/src/Microsoft.TestPlatform.Client/RequestHelper/ITestRequestManager.cs @@ -11,7 +11,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Client.RequestHelper using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.Interfaces; /// - /// Defines the contract that commandline + /// Defines the contract that command line /// public interface ITestRequestManager : IDisposable { diff --git a/src/Microsoft.TestPlatform.Client/TestPlatform.cs b/src/Microsoft.TestPlatform.Client/TestPlatform.cs index 34f5b85a17..8687b79276 100644 --- a/src/Microsoft.TestPlatform.Client/TestPlatform.cs +++ b/src/Microsoft.TestPlatform.Client/TestPlatform.cs @@ -59,7 +59,7 @@ static TestPlatform() /// The test engine. /// /// - /// The filehelper. + /// The file helper. /// /// /// The data. diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionAttachmentManager.cs b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionAttachmentManager.cs index a1ba4b6abf..be447f7fc0 100644 --- a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionAttachmentManager.cs +++ b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionAttachmentManager.cs @@ -44,7 +44,7 @@ internal class DataCollectionAttachmentManager : IDataCollectionAttachmentManage private Dictionary> attachmentTasks; /// - /// Use to cancel attachment transfers if test run is cancelled. + /// Use to cancel attachment transfers if test run is canceled. /// private CancellationTokenSource cancellationTokenSource; diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs index d5e61e98a4..a7c44bbaff 100644 --- a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs +++ b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs @@ -110,7 +110,7 @@ private DataCollectorExtensionManager DataCollectorExtensionManager { if (this.dataCollectorExtensionManager == null) { - // todo : change IMessageSink and use IMessageLogger instead. + // TODO : change IMessageSink and use IMessageLogger instead. this.dataCollectorExtensionManager = DataCollectorExtensionManager.Create(TestSessionMessageLogger.Instance); } @@ -162,7 +162,7 @@ public IDictionary InitializeDataCollectors(string settingsXml) this.attachmentManager.Initialize(sessionId, resultsDirectory, this.messageSink); - // Enviornment variables are passed to testhost process, through ProcessStartInfo.EnvironmentVariables, which handles the key in a case-insensitive manner, which is translated to lowercase. + // Environment variables are passed to testhost process, through ProcessStartInfo.EnvironmentVariables, which handles the key in a case-insensitive manner, which is translated to lowercase. // Therefore, using StringComparer.OrdinalIgnoreCase so that same keys with different cases are treated as same. var executionEnvironmentVariables = new Dictionary(StringComparer.OrdinalIgnoreCase); diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionAttachmentManager.cs b/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionAttachmentManager.cs index 7344fe8942..2b4928c2a2 100644 --- a/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionAttachmentManager.cs +++ b/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionAttachmentManager.cs @@ -58,7 +58,7 @@ internal interface IDataCollectionAttachmentManager void AddAttachment(FileTransferInformation fileTransferInfo, AsyncCompletedEventHandler sendFileCompletedCallback, Uri dataCollectorUri, string friendlyName); /// - /// Stops processing further transfer requests as test run is cancelled. + /// Stops processing further transfer requests as test run is canceled. /// void Cancel(); } diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionManager.cs b/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionManager.cs index 50f56b9453..b43433c968 100644 --- a/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionManager.cs +++ b/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionManager.cs @@ -53,14 +53,14 @@ internal interface IDataCollectionManager : IDisposable /// /// The session start Event Args. /// - /// bolean value specifying whether test case events are subscribed by datacollectors. Based on this execution process will decide whether to send TestCaseStart and TestCaseEnd events to dataCollector process. + /// boolean value specifying whether test case events are subscribed by datacollectors. Based on this execution process will decide whether to send TestCaseStart and TestCaseEnd events to dataCollector process. bool SessionStarted(SessionStartEventArgs sessionStartEventArgs); /// /// Raises SessionEnd event to all data collectors configured for run. /// /// - /// Boolean to specify is the test run is cancelled or not. + /// Boolean to specify is the test run is canceled or not. /// /// /// Collection of session attachmentSet. diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionEvents.cs b/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionEvents.cs index 3d620ce6a4..adb1265374 100644 --- a/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionEvents.cs +++ b/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionEvents.cs @@ -16,12 +16,12 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.DataCollector internal sealed class TestPlatformDataCollectionEvents : DataCollectionEvents { /// - /// Maps the type of event args to the multicast delegate for that event + /// Maps the type of event args to the multi cast delegate for that event /// private Dictionary eventArgsToEventInvokerMap; /// - /// Initializes a new instance of the class by mapping the types of expected event args to the multicast + /// Initializes a new instance of the class by mapping the types of expected event args to the multi cast /// delegate that invokes the event on registered targets /// internal TestPlatformDataCollectionEvents() @@ -120,7 +120,7 @@ private bool HasEventListener(MulticastDelegate eventToCheck, bool valueOnFailur { if (EqtTrace.IsErrorEnabled) { - EqtTrace.Error("TestPlatformDataCollectionEvents.AreTestCaseLevelEventsRequired: Exception occured while checking whether event {0} has any listeners or not. {1}", eventToCheck, ex); + EqtTrace.Error("TestPlatformDataCollectionEvents.AreTestCaseLevelEventsRequired: Exception occurred while checking whether event {0} has any listeners or not. {1}", eventToCheck, ex); } return valueOnFailure; diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionLogger.cs b/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionLogger.cs index c86d9ed87c..5527f0c3a9 100644 --- a/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionLogger.cs +++ b/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionLogger.cs @@ -89,7 +89,7 @@ public override void LogError(DataCollectionContext context, string text, Except exception.StackTrace); } - // Currently there is one type of DataCollectionMessage sent accross client for all message kind. + // Currently there is one type of DataCollectionMessage sent across client for all message kind. // If required new type can be created for different message type. var message = string.Format( CultureInfo.CurrentCulture, diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestDiscoveryExtensionManager.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestDiscoveryExtensionManager.cs index e5fa418ea9..c8d9acd034 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestDiscoveryExtensionManager.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestDiscoveryExtensionManager.cs @@ -139,7 +139,7 @@ internal static void LoadAndInitializeAllExtensions(bool throwOnError) { if (EqtTrace.IsErrorEnabled) { - EqtTrace.Error("TestDiscoveryManager: LoadExtensions: Exception occured while loading extensions {0}", ex); + EqtTrace.Error("TestDiscoveryManager: LoadExtensions: Exception occurred while loading extensions {0}", ex); } if (throwOnError) diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestExecutorExtensionManager.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestExecutorExtensionManager.cs index 1fd76974af..4701aa10a4 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestExecutorExtensionManager.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestExecutorExtensionManager.cs @@ -15,7 +15,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; /// - /// Manages the the Test Executor extensions. + /// Manages the Test Executor extensions. /// internal class TestExecutorExtensionManager : TestExtensionManager { @@ -142,7 +142,7 @@ internal static void LoadAndInitializeAllExtensions(bool shouldThrowOnError) if (EqtTrace.IsErrorEnabled) { EqtTrace.Error( - "TestExecutorExtensionManager: LoadAndInitialize: Exception occured while loading extensions {0}", + "TestExecutorExtensionManager: LoadAndInitialize: Exception occurred while loading extensions {0}", ex); } diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginCache.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginCache.cs index a66bb7b6ca..b804aef0c9 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginCache.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginCache.cs @@ -140,7 +140,7 @@ public List GetExtensionPaths(string endsWithPattern, bool skipDefaultEx public Dictionary DiscoverTestExtensions(string endsWithPattern) where TPluginInfo : TestPluginInformation { - EqtTrace.Verbose("TestPluginCache.DiscoverTestExtensions: finding test extensions in assemblies endswith: {0} TPluginInfo: {1} TExtension: {2}", endsWithPattern, typeof(TPluginInfo), typeof(TExtension)); + EqtTrace.Verbose("TestPluginCache.DiscoverTestExtensions: finding test extensions in assemblies ends with: {0} TPluginInfo: {1} TExtension: {2}", endsWithPattern, typeof(TPluginInfo), typeof(TExtension)); // Return the cached value if cache is valid. if (this.TestExtensions != null && this.TestExtensions.AreTestExtensionsCached()) { @@ -252,7 +252,7 @@ public void UpdateExtensions(IEnumerable additionalExtensionsPath, bool if (skipExtensionFilters) { - // Add the extensions to unfilter list. These extensions will never be filtered + // Add the extensions to un-filter list. These extensions will never be filtered // based on file name (e.g. *.testadapter.dll etc.). if (TryMergeExtensionPaths(this.unfilterableExtensionPaths, extensions, out this.unfilterableExtensionPaths)) @@ -536,7 +536,7 @@ private Assembly CurrentDomainAssemblyResolve(object sender, AssemblyResolveEven } // Put it in the resolved assembly so that if below Assembly.Load call - // triggers another assembly resolution, then we dont end up in stack overflow + // triggers another assembly resolution, then we don't end up in stack overflow this.resolvedAssemblies[args.Name] = null; assembly = Assembly.Load(assemblyName); diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs index af000b0ec9..5852498f71 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs @@ -76,7 +76,7 @@ internal TestPluginDiscoverer(IFileHelper fileHelper) /// The path to the extensions. /// /// - /// A dictionary of assembly qualified name and testplugin information. + /// A dictionary of assembly qualified name and test plugin information. /// public Dictionary GetTestExtensionsInformation(IEnumerable extensionPaths) where TPluginInfo : TestPluginInformation { @@ -101,14 +101,14 @@ public Dictionary GetTestExtensionsInformation extensionPaths) { - // For C++ UWP adatper, & OLD C# UWP(MSTest V1) adatper + // For C++ UWP adapter, & OLD C# UWP(MSTest V1) adapter // In UWP .Net Native Compilation mode managed dll's are packaged differently, & File.Exists() fails. // Include these two dll's if so far no adapters(extensions) were found, & let Assembly.Load() fail if they are not present. extensionPaths = extensionPaths.Concat(new[] { "Microsoft.VisualStudio.TestTools.CppUnitTestFramework.CppUnitTestExtension.dll", "Microsoft.VisualStudio.TestPlatform.Extensions.MSAppContainerAdapter.dll" }); } /// - /// Gets test extension information from the given colletion of files. + /// Gets test extension information from the given collection of files. /// /// /// Type of Test Plugin Information. diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs index fd94f4f9c6..679f2a0ff0 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs @@ -81,7 +81,7 @@ private static string GetExtensionUri(Type testLoggerType) if (EqtTrace.IsErrorEnabled && string.IsNullOrEmpty(extensionUri)) { - EqtTrace.Error("The type \"{0}\" defined in \"{1}\" does not have ExtensionUri attibute.", testLoggerType.ToString(), testLoggerType.Module.Name); + EqtTrace.Error("The type \"{0}\" defined in \"{1}\" does not have ExtensionUri attribute.", testLoggerType.ToString(), testLoggerType.Module.Name); } return extensionUri; diff --git a/src/Microsoft.TestPlatform.Common/Filtering/Condition.cs b/src/Microsoft.TestPlatform.Common/Filtering/Condition.cs index a6688709f9..f6678292cb 100644 --- a/src/Microsoft.TestPlatform.Common/Filtering/Condition.cs +++ b/src/Microsoft.TestPlatform.Common/Filtering/Condition.cs @@ -23,8 +23,8 @@ internal enum Operation /// /// Operator in order of precedence. - /// Predence(And) > Predence(Or) - /// Precdence of OpenBrace and CloseBrace operators is not used, instead parsing code takes care of same. + /// Precedence(And) > Precedence(Or) + /// Precedence of OpenBrace and CloseBrace operators is not used, instead parsing code takes care of same. /// internal enum Operator { @@ -135,7 +135,7 @@ internal bool Evaluate(Func propertyValueProvider) break; case Operation.Contains: - // if any value in mulit-valued property contains 'this.Value' for 'Contains' to be true. + // if any value in multi-valued property contains 'this.Value' for 'Contains' to be true. if (null != multiValue) { foreach (string propertyValue in multiValue) diff --git a/src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs b/src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs index c2b91272ea..6e9f211300 100644 --- a/src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs +++ b/src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs @@ -179,8 +179,8 @@ internal static FilterExpression Parse(string filterString, out FastFilter fastF var fastFilterBuilder = FastFilter.CreateBuilder(); - // This is based on standard parsing of inorder expression using two stacks (operand stack and operator stack) - // Predence(And) > Predence(Or) + // This is based on standard parsing of in order expression using two stacks (operand stack and operator stack) + // Precedence(And) > Precedence(Or) foreach (var inputToken in tokens) { var token = inputToken.Trim(); @@ -204,7 +204,7 @@ internal static FilterExpression Parse(string filterString, out FastFilter fastF fastFilterBuilder.AddOperator(currentOperator); // Always put only higher priority operator on stack. - // if lesser prioriy -- pop up the stack and process the operator to maintain operator precedence. + // if lesser priority -- pop up the stack and process the operator to maintain operator precedence. // if equal priority -- pop up the stack and process the operator to maintain operator associativity. // OpenBrace is special condition. & or | can come on top of OpenBrace for case like ((a=b)&c=d) while (true) diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IParallelProxyExecutionManager.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IParallelProxyExecutionManager.cs index 19a9bf0dd2..3834ce414c 100644 --- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IParallelProxyExecutionManager.cs +++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IParallelProxyExecutionManager.cs @@ -13,7 +13,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Engine public interface IParallelProxyExecutionManager : IParallelOperationManager, IProxyExecutionManager { /// - /// Handles Partial Run Complete event coming from a specific concurrent proxy exceution manager + /// Handles Partial Run Complete event coming from a specific concurrent proxy execution manager /// Each concurrent proxy execution manager will signal the parallel execution manager when its complete /// /// Concurrent Execution manager that completed the run diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IExecutionManager.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IExecutionManager.cs index 7828159fca..1fa3dca2cc 100644 --- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IExecutionManager.cs +++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IExecutionManager.cs @@ -24,7 +24,7 @@ public interface IExecutionManager /// Starts the test run with sources. /// /// The adapter Source Map. - /// The packages which actually contain sources. A testhost can at max execute for one pakage at time + /// The packages which actually contain sources. A testhost can at max execute for one package at time /// Package can be null if test source, and package are same /// /// The run Settings. @@ -37,7 +37,7 @@ public interface IExecutionManager /// Starts the test run with tests. /// /// The test list. - /// The packages which actually contain sources. A testhost can at max execute for one pakage at time + /// The packages which actually contain sources. A testhost can at max execute for one package at time /// Package can be null if test source, and package are same /// /// The run Settings. diff --git a/src/Microsoft.TestPlatform.Common/Logging/InternalTestLoggerEvents.cs b/src/Microsoft.TestPlatform.Common/Logging/InternalTestLoggerEvents.cs index ef05917405..725fc1c5d4 100644 --- a/src/Microsoft.TestPlatform.Common/Logging/InternalTestLoggerEvents.cs +++ b/src/Microsoft.TestPlatform.Common/Logging/InternalTestLoggerEvents.cs @@ -70,7 +70,7 @@ public InternalTestLoggerEvents(TestSessionMessageLogger testSessionMessageLogge (message) => EqtTrace.Error(message)); this.loggerEventQueue.Pause(); - // Register for events from the test run message logger so they + // Register for events from the test run message logger so they // can be raised to the loggers. this.testSessionMessageLogger = testSessionMessageLogger; this.testSessionMessageLogger.TestRunMessage += this.TestRunMessageHandler; @@ -164,15 +164,15 @@ internal void EnableEvents() // Allow currently queued events to flush from the queue. This is done so that information // logged during initialization completes processing before we begin other tasks. This is - // important for instance when errors are logged during initilization and need to be output - // to the console before we begin outputing other information to the console. + // important for instance when errors are logged during initialization and need to be output + // to the console before we begin outputting other information to the console. this.loggerEventQueue.Flush(); } /// /// Raises a test run message event to the enabled loggers. /// - /// Arguments to to be raised. + /// Arguments to be raised. internal void RaiseTestRunMessage(TestRunMessageEventArgs args) { if (args == null) @@ -182,7 +182,7 @@ internal void RaiseTestRunMessage(TestRunMessageEventArgs args) this.CheckDisposed(); - // Sending 0 size as this event is not expected to contain any data. + // Sending 0 size as this event is not expected to contain any data. this.SafeInvokeAsync(() => this.TestRunMessage, args, 0, "InternalTestLoggerEvents.SendTestRunMessage"); } @@ -214,7 +214,7 @@ internal void RaiseTestResult(TestResultEventArgs args) /// /// Raises the test run start event to enabled loggers. /// - /// Arguments to to be raised. + /// Arguments to be raised. internal void RaiseTestRunStart(TestRunStartEventArgs args) { ValidateArg.NotNull(args, "args"); @@ -227,7 +227,7 @@ internal void RaiseTestRunStart(TestRunStartEventArgs args) /// /// Raises a discovery start event to the enabled loggers. /// - /// Arguments to to be raised. + /// Arguments to be raised. internal void RaiseDiscoveryStart(DiscoveryStartEventArgs args) { ValidateArg.NotNull(args, "args"); @@ -240,7 +240,7 @@ internal void RaiseDiscoveryStart(DiscoveryStartEventArgs args) /// /// Raises a discovery message event to the enabled loggers. /// - /// Arguments to to be raised. + /// Arguments to be raised. internal void RaiseDiscoveryMessage(TestRunMessageEventArgs args) { ValidateArg.NotNull(args, "args"); @@ -254,7 +254,7 @@ internal void RaiseDiscoveryMessage(TestRunMessageEventArgs args) /// /// Raises discovered tests event to the enabled loggers. /// - /// Arguments to to be raised. + /// Arguments to be raised. internal void RaiseDiscoveredTests(DiscoveredTestsEventArgs args) { ValidateArg.NotNull(args, "args"); @@ -267,7 +267,7 @@ internal void RaiseDiscoveredTests(DiscoveredTestsEventArgs args) /// /// Raises discovery complete event to the enabled loggers. /// - /// Arguments to to be raised. + /// Arguments to be raised. internal void RaiseDiscoveryComplete(DiscoveryCompleteEventArgs args) { ValidateArg.NotNull(args, "args"); @@ -303,7 +303,7 @@ internal void RaiseTestRunComplete(TestRunCompleteEventArgs args) /// for the events to be processed. /// /// Specifies the stats of the test run. - /// Specifies whether the test run is cancelled. + /// Specifies whether the test run is canceled. /// Specifies whether the test run is aborted. /// Specifies the error that occurs during the test run. /// Run level attachment sets @@ -314,7 +314,7 @@ internal void CompleteTestRun(ITestRunStatistics stats, bool isCanceled, bool is var args = new TestRunCompleteEventArgs(stats, isCanceled, isAborted, error, attachmentSet, elapsedTime); - // Sending 0 size as this event is not expected to contain any data. + // Sending 0 size as this event is not expected to contain any data. this.SafeInvokeAsync(() => this.TestRunComplete, args, 0, "InternalTestLoggerEvents.SendTestRunComplete"); // Wait for the loggers to finish processing the messages for the run. @@ -373,8 +373,8 @@ private void CheckDisposed() } /// - /// The method parses the config file of vstest.console.exe to see if the Max Job Queue Length is defined. - /// Return the Max Queue Length so defined or a default value specifed by TestPlatformDefaults.DefaultMaxLoggerEventsToCache + /// The method parses the config file of vstest.console.exe to see if the Max Job Queue Length is defined. + /// Return the Max Queue Length so defined or a default value specified by TestPlatformDefaults.DefaultMaxLoggerEventsToCache /// private int GetMaxNumberOfJobsInQueue() { @@ -383,8 +383,8 @@ private int GetMaxNumberOfJobsInQueue() } /// - /// The method parses the config file of vstest.console.exe to see if the Max Job Queue size is defined. - /// Return the Max Queue size so defined or a default value specifed by TestPlatformDefaults.DefaultMaxJobQueueSize + /// The method parses the config file of vstest.console.exe to see if the Max Job Queue size is defined. + /// Return the Max Queue size so defined or a default value specified by TestPlatformDefaults.DefaultMaxJobQueueSize /// private int GetMaxBytesQueueCanHold() { @@ -393,7 +393,7 @@ private int GetMaxBytesQueueCanHold() } /// - /// Returns whether flow control on logger events queue should be enabled or not. Default is enabled. + /// Returns whether flow control on logger events queue should be enabled or not. Default is enabled. /// private static bool IsBoundsEnabledOnLoggerEventQueue() { @@ -439,7 +439,7 @@ private static int FindTestResultSize(TestResultEventArgs args) /// /// Get the appsetting value for the parameter appSettingKey. Use the parameter defaultValue if - /// value is not there or is invalid. + /// value is not there or is invalid. /// private int GetSetting(string appSettingKey, int defaultValue) { diff --git a/src/Microsoft.TestPlatform.Common/Resources/Resources.Designer.cs b/src/Microsoft.TestPlatform.Common/Resources/Resources.Designer.cs index 541a9fb661..4907235e78 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/Resources.Designer.cs +++ b/src/Microsoft.TestPlatform.Common/Resources/Resources.Designer.cs @@ -178,7 +178,7 @@ internal static string FailedToLoadAdapaterFile { } /// - /// Looks up a localized string similar to An error occured while creating Fast filter.. + /// Looks up a localized string similar to An error occurred while creating Fast filter.. /// internal static string FastFilterException { get { diff --git a/src/Microsoft.TestPlatform.Common/Resources/Resources.resx b/src/Microsoft.TestPlatform.Common/Resources/Resources.resx index 66a2074364..42d99d6496 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/Resources.resx +++ b/src/Microsoft.TestPlatform.Common/Resources/Resources.resx @@ -157,7 +157,7 @@ Failed to load extensions from file '{0}'. Please use /diag for more information. - An error occured while creating Fast filter. + An error occurred while creating Fast filter. There are multiple configurations that have data collector FriendlyName as '{0}'. Duplicate configurations will be ignored in the test run. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.cs.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.cs.xlf index 4747df02a6..777062bea9 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.cs.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.cs.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. Při vytváření rychlého filtru došlo k chybě. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.de.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.de.xlf index 432bb99cf5..6aa6c9ec9c 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.de.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.de.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. Fehler beim Erstellen eines Schnellfilters. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.es.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.es.xlf index 44b0ea6386..cac576ceaf 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.es.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.es.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. Error al crear el filtro rápido. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.fr.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.fr.xlf index 46fd06f544..8e5bdb29a5 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.fr.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.fr.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. Une erreur s'est produite lors de la création du filtre rapide. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.it.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.it.xlf index 122b54a88e..9acd95d595 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.it.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.it.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. Si è verificato un errore durante la creazione del filtro Fast. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ja.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ja.xlf index c2ad50fa4f..0326b6cae0 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ja.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ja.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. 高速フィルターを作成中にエラーが発生しました。 diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ko.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ko.xlf index 644796b039..6d84c20c02 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ko.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ko.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. 빠른 필터를 만드는 중 오류가 발생했습니다. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pl.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pl.xlf index f22f84c02c..0eb75ee926 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pl.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pl.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. Wystąpił błąd podczas tworzenia szybkiego filtru. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pt-BR.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pt-BR.xlf index b08f2d75be..750adbb9fa 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pt-BR.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pt-BR.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. Ocorreu um erro ao criar o filtro Rápido. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ru.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ru.xlf index 65b65eda47..7f18b7f337 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ru.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ru.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. При создании быстрого (Fast) фильтра произошла ошибка. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.tr.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.tr.xlf index 54d48f12b1..eb2f057f94 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.tr.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.tr.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. Hızlı filtre oluşturulurken bir hata oluştu. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.xlf index 4e6a67d1be..d1ce2a6073 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.xlf @@ -137,8 +137,8 @@ - An error occured while creating Fast filter. - An error occured while creating Fast filter. + An error occurred while creating Fast filter. + An error occurred while creating Fast filter. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hans.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hans.xlf index 71f4f362d3..ee7da9c276 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hans.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hans.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. 创建“快”筛选器时遇到错误。 diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hant.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hant.xlf index 276ae44fff..0716fabc69 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hant.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hant.xlf @@ -260,7 +260,7 @@ - An error occured while creating Fast filter. + An error occurred while creating Fast filter. 建立快速篩選時發生錯誤。 diff --git a/src/Microsoft.TestPlatform.Common/RunSettings.cs b/src/Microsoft.TestPlatform.Common/RunSettings.cs index f97107aa82..cc86218fe0 100644 --- a/src/Microsoft.TestPlatform.Common/RunSettings.cs +++ b/src/Microsoft.TestPlatform.Common/RunSettings.cs @@ -174,7 +174,7 @@ private void ReadRunSettings(XmlReader reader) // Read to the root element. XmlReaderUtilities.ReadToRootNode(reader); - // Read to the the first section. + // Read to the first section. reader.ReadToNextElement(); // Lookup the settings provider for each of the elements. diff --git a/src/Microsoft.TestPlatform.Common/SettingsProvider/SettingsProviderExtensionManager.cs b/src/Microsoft.TestPlatform.Common/SettingsProvider/SettingsProviderExtensionManager.cs index f855cb4bfc..d40575e0b5 100644 --- a/src/Microsoft.TestPlatform.Common/SettingsProvider/SettingsProviderExtensionManager.cs +++ b/src/Microsoft.TestPlatform.Common/SettingsProvider/SettingsProviderExtensionManager.cs @@ -160,7 +160,7 @@ public static void LoadAndInitializeAllExtensions(bool shouldThrowOnError) { if (EqtTrace.IsErrorEnabled) { - EqtTrace.Error("SettingsProviderExtensionManager: LoadAndInitialize: Exception occured while loading extensions {0}", ex); + EqtTrace.Error("SettingsProviderExtensionManager: LoadAndInitialize: Exception occurred while loading extensions {0}", ex); } if (shouldThrowOnError) diff --git a/src/Microsoft.TestPlatform.Common/Utilities/AssemblyResolver.cs b/src/Microsoft.TestPlatform.Common/Utilities/AssemblyResolver.cs index 8fd15ed633..603312785b 100644 --- a/src/Microsoft.TestPlatform.Common/Utilities/AssemblyResolver.cs +++ b/src/Microsoft.TestPlatform.Common/Utilities/AssemblyResolver.cs @@ -174,7 +174,7 @@ private Assembly OnResolve(object sender, AssemblyResolveEventArgs args) { EqtTrace.Info("AssemblyResolver.OnResolve: {0}: Failed to load assembly. Reason:{1} ", args.Name, ex); - // Rethrow FileLoadException, because this exception means that the assembly + // Re-throw FileLoadException, because this exception means that the assembly // was found, but could not be loaded. This will allow us to report a more // specific error message to the user for things like access denied. throw; diff --git a/src/Microsoft.TestPlatform.Common/Utilities/CancellationTokenExtensions.cs b/src/Microsoft.TestPlatform.Common/Utilities/CancellationTokenExtensions.cs index 0b5147b771..a09eefbdf0 100644 --- a/src/Microsoft.TestPlatform.Common/Utilities/CancellationTokenExtensions.cs +++ b/src/Microsoft.TestPlatform.Common/Utilities/CancellationTokenExtensions.cs @@ -9,7 +9,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.Utilities public static class CancellationTokenExtensions { /// - /// Extension method used to throw TestPlatformException in case operation is cancelled. + /// Extension method used to throw TestPlatformException in case operation is canceled. /// /// CancellationToken on which cancel is requested public static void ThrowTestPlatformExceptionIfCancellationRequested(this CancellationToken token) diff --git a/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs b/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs index 4ab74192d8..d07109a722 100644 --- a/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs +++ b/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs @@ -44,7 +44,7 @@ public static string GenerateFakesSettingsForRunConfiguration(string[] sources, throw new ArgumentNullException(nameof(runSettingsXml)); } - // donot generate fakes for netcore + // do not generate fakes for netcore if (IsNetCoreFramework(runSettingsXml)) { return runSettingsXml; diff --git a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs index 406db01feb..7759655843 100644 --- a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs +++ b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs @@ -16,7 +16,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.Utilities using System.Text.RegularExpressions; /// - /// Utilities to get the run settings from the provider and the commandline options specified. + /// Utilities to get the run settings from the provider and the command line options specified. /// internal static class RunSettingsProviderExtensions { diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestHandler.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestHandler.cs index 80508b75dd..650c5981e4 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestHandler.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestHandler.cs @@ -51,7 +51,7 @@ internal class DataCollectionRequestHandler : IDataCollectionRequestHandler, IDi private IFileHelper fileHelper; /// - /// Use to cancel data collection test case events monitoring if test run is cancelled. + /// Use to cancel data collection test case events monitoring if test run is canceled. /// private CancellationTokenSource cancellationTokenSource; @@ -284,17 +284,17 @@ private void AddExtensionAssemblies(BeforeTestRunStartPayload payload) } catch (Exception e) { - // If any exception is throuwn while updating additional assemblies, log the exception in eqt trace. + // If any exception is thrown while updating additional assemblies, log the exception in eqt trace. if (EqtTrace.IsErrorEnabled) { - EqtTrace.Error("DataCollectionRequestHandler.AddExtensionAssemblies: Exception occured: {0}", e); + EqtTrace.Error("DataCollectionRequestHandler.AddExtensionAssemblies: Exception occurred: {0}", e); } } } private void HandleBeforeTestRunStart(Message message) { - // Initialize datacollectors and get enviornment variables. + // Initialize datacollectors and get environment variables. var payload = this.dataSerializer.DeserializePayload(message); this.AddExtensionAssemblies(payload); @@ -340,7 +340,7 @@ private void HandleBeforeTestRunStart(Message message) } catch (Exception e) { - EqtTrace.Error("DataCollectionRequestHandler.HandleBeforeTestRunStart : Error occured during initialization of TestHost : {0}", e); + EqtTrace.Error("DataCollectionRequestHandler.HandleBeforeTestRunStart : Error occurred during initialization of TestHost : {0}", e); } }, this.cancellationTokenSource.Token); @@ -374,7 +374,7 @@ private void HandleAfterTestRunEnd(Message message) var attachmentsets = this.dataCollectionManager.SessionEnded(isCancelled); - // Dispose all datacollectors before sending attachements to vstest.console process. + // Dispose all datacollectors before sending attachments to vstest.console process. // As datacollector process exits itself on parent process(vstest.console) exits. this.dataCollectionManager?.Dispose(); diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionTestCaseEventSender.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionTestCaseEventSender.cs index 0f2aba6cd3..6cd01bd90e 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionTestCaseEventSender.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionTestCaseEventSender.cs @@ -41,7 +41,7 @@ protected DataCollectionTestCaseEventSender(ICommunicationManager communicationM /// /// Gets the singleton instance of DataCollectionTestCaseEventSender. /// - // todo : Refactor to pass the instance as singleton. + // TODO : Re-factor to pass the instance as singleton. public static DataCollectionTestCaseEventSender Instance { get; private set; } /// diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionRequestSender.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionRequestSender.cs index ddbbdd1e46..4e70e5ea41 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionRequestSender.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionRequestSender.cs @@ -66,7 +66,7 @@ internal interface IDataCollectionRequestSender /// Test message event handler for handling messages. /// /// - /// The value to specify whether the test run is cancelled or not. + /// The value to specify whether the test run is canceled or not. /// /// /// DataCollector attachments diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionTestCaseEventHandler.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionTestCaseEventHandler.cs index 16dffa189d..214346dbb5 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionTestCaseEventHandler.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionTestCaseEventHandler.cs @@ -4,11 +4,11 @@ namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces { /// - /// Interface for interacting with execution process for getting test case events in datacollection process. + /// Interface for interacting with execution process for getting test case events in data collection process. /// internal interface IDataCollectionTestCaseEventHandler { - // todo : Similar interfaces exist, need redesign. + // TODO : Similar interfaces exist, need redesign. /// /// Initializes the communication for sending requests diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/ITestRequestHandler.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/ITestRequestHandler.cs index e15bb9a203..095ab878e2 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/ITestRequestHandler.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/ITestRequestHandler.cs @@ -75,7 +75,7 @@ public interface ITestRequestHandler : IDisposable /// /// The discovery complete handler /// - /// Discovery Compelete Event Args + /// Discovery Complete Event Args /// The last Chunk. void DiscoveryComplete(DiscoveryCompleteEventArgs discoveryCompleteEventArgs, IEnumerable lastChunk); diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/ObjectModel/TestRunCriteriaWithSources.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/ObjectModel/TestRunCriteriaWithSources.cs index 4e190233e8..e6017ae73a 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/ObjectModel/TestRunCriteriaWithSources.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/ObjectModel/TestRunCriteriaWithSources.cs @@ -19,7 +19,7 @@ public class TestRunCriteriaWithSources /// Initializes a new instance of the class. /// /// The adapter source map. - /// The package which actually contain sources. A testhost can at max execute for one pakage at time + /// The package which actually contain sources. A testhost can at max execute for one package at time /// Package can be null if test source, and package are same /// /// The run settings. diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/ObjectModel/TestRunCriteriaWithTests.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/ObjectModel/TestRunCriteriaWithTests.cs index 1b09e918ac..443429eee2 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/ObjectModel/TestRunCriteriaWithTests.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/ObjectModel/TestRunCriteriaWithTests.cs @@ -21,7 +21,7 @@ public class TestRunCriteriaWithTests /// Ensure that names of constructor parameters match the public property names of the same for JSON serialization /// /// The tests. - /// The package which actually contain sources. A testhost can at max execute for one pakage at time + /// The package which actually contain sources. A testhost can at max execute for one package at time /// Package can be null if test source, and package are same /// /// The test run settings. diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketClient.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketClient.cs index e7dbdd25ec..180180e385 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketClient.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketClient.cs @@ -83,7 +83,7 @@ private void OnServerConnected(Task connectAsyncTask) this.Connected.SafeInvoke(this, new ConnectedEventArgs(connectAsyncTask.Exception), "SocketClient: Server Failed to Connect"); if (EqtTrace.IsVerboseEnabled) { - EqtTrace.Verbose("Unable to connect to server, Exception occured : {0}", connectAsyncTask.Exception); + EqtTrace.Verbose("Unable to connect to server, Exception occurred : {0}", connectAsyncTask.Exception); } } else diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs index 411dcaf88b..a0d2540eae 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs @@ -163,7 +163,7 @@ public void StopServer() /// A representing the asynchronous operation. public async Task SetupClientAsync(IPEndPoint endpoint) { - // ToDo: pass cancellationtoken, if user cancels the operation, so we don't wait 50 secs to connect + // TODO: pass cancellation token, if user cancels the operation, so we don't wait 50 secs to connect // for now added a check for validation of this.tcpclient this.clientConnectionAcceptedEvent.Reset(); EqtTrace.Info("Trying to connect to server on socket : {0} ", endpoint); diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketServer.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketServer.cs index 6ff8c43790..7986e81fb7 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketServer.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketServer.cs @@ -107,7 +107,7 @@ private void OnClientConnected(TcpClient client) private void Stop(Exception error) { - EqtTrace.Info("SocketServer.PrivateStop: Stopp server endPoint: {0} error: {1}", this.endPoint, error); + EqtTrace.Info("SocketServer.PrivateStop: Stop server endPoint: {0} error: {1}", this.endPoint, error); if (!this.stopped) { diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs index 755f39cd13..ab1ffd4827 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs @@ -146,7 +146,7 @@ public bool WaitForRequestHandlerConnection(int connectionTimeout, CancellationT } // Wait until either connection is successful, handled by connected.WaitHandle - // or operation is cancelled, handled by cancellationToken.WaitHandle + // or operation is canceled, handled by cancellationToken.WaitHandle // or testhost exits unexpectedly, handled by clientExited.WaitHandle var waitIndex = WaitHandle.WaitAny(new WaitHandle[] { this.connected.WaitHandle, cancellationToken.WaitHandle, this.clientExited.WaitHandle }, connectionTimeout); @@ -380,7 +380,7 @@ public void OnClientProcessExit(string stdError) this.clientExitErrorMessage = stdError; this.clientExited.Set(); - // Break communication loop. In somecases(E.g: When tests creates child processes to testhost) communication channel won't break if testhost exits. + // Break communication loop. In some cases (E.g: When tests creates child processes to testhost) communication channel won't break if testhost exits. this.communicationEndpoint.Stop(); } diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Tracing/EqtTrace.cs b/src/Microsoft.TestPlatform.CoreUtilities/Tracing/EqtTrace.cs index 9050c3a8db..bb43be33ce 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Tracing/EqtTrace.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Tracing/EqtTrace.cs @@ -341,7 +341,7 @@ public static void Error(Exception exceptionToTrace) Debug.Assert(exceptionToTrace != null, "exceptionToTrace != null"); // Write only if tracing for error is enabled. - // Done upfront to avoid perf hit. + // Done upfront to avoid performance hit. if (traceImpl.ShouldTrace(PlatformTraceLevel.Error)) { // Write at error level diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Utilities/JobQueue.cs b/src/Microsoft.TestPlatform.CoreUtilities/Utilities/JobQueue.cs index bdee14cbe9..f60d16c99d 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Utilities/JobQueue.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Utilities/JobQueue.cs @@ -327,7 +327,7 @@ private void BackgroundJobProcessor() // Reset the manual reset event so we get notified of new jobs that are added. this.jobAdded.Reset(); - // Releases a thread waiting on the queue to get empty, to continue with the enquing process. + // Releases a thread waiting on the queue to get empty, to continue with the enqueuing process. if (this.enableBoundsOnQueue) { Monitor.PulseAll(this.jobsQueue); diff --git a/src/Microsoft.TestPlatform.CoreUtilities/ValidateArg.cs b/src/Microsoft.TestPlatform.CoreUtilities/ValidateArg.cs index e911a9117a..c5b641c91a 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/ValidateArg.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/ValidateArg.cs @@ -87,7 +87,7 @@ public static string NotNullOrEmpty([ValidatedNotNull]string arg, string paramet /// Validated string. /// /// - /// Thrown if the input string is null null, empty or consists only of white-space characters. + /// Thrown if the input string is null, empty or consists only of white-space characters. /// [DebuggerStepThrough] public static string NotNullOrWhiteSpace([ValidatedNotNull]string arg, string parameterName) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/RunContext.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/RunContext.cs index 976efb287a..c2233ded9b 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/RunContext.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/RunContext.cs @@ -17,7 +17,7 @@ public class RunContext : DiscoveryContext, IRunContext public bool KeepAlive { get; internal set; } /// - /// Gets a value indicating whether the discovery or execution is happening in In-process or out-of-process. + /// Gets a value indicating whether the discovery or execution is happening in-process or out-of-process. /// public bool InIsolation { get; internal set; } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/LoggerNameValueConfigurationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/LoggerNameValueConfigurationManager.cs index 2e2565eef7..305fb5a5c8 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/LoggerNameValueConfigurationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/LoggerNameValueConfigurationManager.cs @@ -63,7 +63,7 @@ private void Initialize(XmlElement configurationElement) } // Save the name/value pair in the dictionary. Note that duplicate settings are - // overwritten with the last occurrance's value. + // overwritten with the last occurrence's value. if (this.nameValuePairs.ContainsKey(settingName)) { EqtTrace.Verbose( diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryDataAggregator.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryDataAggregator.cs index e2fdd1e74f..6767b5bfa9 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryDataAggregator.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryDataAggregator.cs @@ -45,7 +45,7 @@ public ParallelDiscoveryDataAggregator() #region Public Methods /// - /// Returns the Aggregated Metrcis. + /// Returns the Aggregated Metrics. /// /// public IDictionary GetAggregatedDiscoveryDataMetrics() diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs index aff3c52c79..fbd8a7b9f5 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs @@ -224,8 +224,8 @@ private void DoManagerAction(Action action) catch (Exception ex) { // Exception can occur if we are trying to cancel a test run on an executor where test run is not even fired - // we can safely ignore that as user is just cancelling the test run and we don't care about additional parallel executors - // as we will be disposing them off soon ansyway + // we can safely ignore that as user is just canceling the test run and we don't care about additional parallel executors + // as we will be disposing them off soon anyway if (EqtTrace.IsWarningEnabled) { EqtTrace.Warning("AbstractParallelOperationManager: Exception while invoking an action on Proxy Manager instance: {0}", ex); diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs index 314bee403f..3dc43912ae 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs @@ -155,7 +155,7 @@ public void Close() #region IParallelProxyExecutionManager methods /// - /// Handles Partial Run Complete event coming from a specific concurrent proxy exceution manager + /// Handles Partial Run Complete event coming from a specific concurrent proxy execution manager /// Each concurrent proxy execution manager will signal the parallel execution manager when its complete /// /// Concurrent Execution manager that completed the run @@ -204,7 +204,7 @@ public bool HandlePartialRunComplete( this.currentRunEventsHandler = null; // Dispose concurrent executors - // Do not do the cleanuptask in the current thread as we will unncessarily add to execution time + // Do not do the cleanuptask in the current thread as we will unnecessarily add to execution time this.UpdateParallelLevel(0); return true; diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs index c0933108cf..fba4cb72e5 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs @@ -94,7 +94,7 @@ protected ProxyOperationManager(IRequestData requestData, ITestRequestSender req /// /// /// - /// Returns true if Communation is established b/w runner and host + /// Returns true if Communication is established b/w runner and host /// public virtual bool SetupChannel(IEnumerable sources, string runSettings) { @@ -235,7 +235,7 @@ public virtual void Close() #endregion /// - /// This method is exposed to enable drived classes to modify TestProcessStartInfo. E.g. DataCollection need additional environment variables to be passed, etc. + /// This method is exposed to enable derived classes to modify TestProcessStartInfo. E.g. DataCollection need additional environment variables to be passed, etc. /// /// /// The sources. @@ -271,7 +271,7 @@ protected string GetTimestampedLogFile(string logFile) /// This function will remove the unknown runsettings node from runsettings for old testhost who throws exception for unknown node. /// /// runsettings string - /// runsetting after removing unrequired nodes + /// runsetting after removing un-required nodes protected string RemoveNodesFromRunsettingsIfRequired(string runsettingsXml, Action logMessage) { var updatedRunSettingsXml = runsettingsXml; @@ -334,7 +334,7 @@ private void ThrowExceptionOnConnectionFailure(int connTimeout) // Failed to launch testhost process. var errorMsg = CrossPlatEngineResources.InitializationFailed; - // Testhost launched but Timeout occured due to machine slowness. + // Testhost launched but Timeout occurred due to machine slowness. if (this.testHostLaunched) { errorMsg = string.Format( diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs index c17b898d8f..616f48d165 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs @@ -150,7 +150,7 @@ public void Initialize(string runSettings) foreach (var logger in loggers?.LoggerSettingsList ?? Enumerable.Empty()) { - // Dont add logger if its disabled. + // Don't add logger if its disabled. if (!logger.IsEnabled) { continue; @@ -581,7 +581,7 @@ private bool InitializeLoggerByType(string assemblyQualifiedName, string codeBas catch (Exception ex) { EqtTrace.Error( - "TestLoggerManager: Error occured while initializing the Logger assemblyQualifiedName : {0}, codeBase : {1} , Exception Details : {2}", assemblyQualifiedName, codeBase, ex); + "TestLoggerManager: Error occurred while initializing the Logger assemblyQualifiedName : {0}, codeBase : {1} , Exception Details : {2}", assemblyQualifiedName, codeBase, ex); return false; } } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Constants.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Constants.cs index 44754c2535..ed32ca47f4 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Constants.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Constants.cs @@ -13,7 +13,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine /// public class Constants { - // Replace this collection with list of adapters we want to whitelist from "Extensions" folder in Next Major VS Release + // Replace this collection with list of adapters we want to white list from "Extensions" folder in Next Major VS Release internal static readonly IList DefaultAdapters = new ReadOnlyCollection(new List { "executor://CodedWebTestAdapter/v1", diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs index c14dd3c9ad..6c04ed01dc 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs @@ -164,7 +164,7 @@ public int LaunchProcessWithDebuggerAttached(TestProcessStartInfo testProcessSta /// The run attachments. /// /// - /// The runcontext attachments. + /// The run context attachments. /// /// /// The . diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs index 3bd88022ab..7e82007df3 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs @@ -51,7 +51,7 @@ internal class InProcDataCollectionExtensionManager /// The data collection test case event manager. /// /// - /// The default codebase to be used by inproc data collector + /// The default code base to be used by in-proc data collector /// public InProcDataCollectionExtensionManager(string runSettings, ITestEventsPublisher testEventsPublisher, string defaultCodeBase, TestPluginCache testPluginCache) : this(runSettings, testEventsPublisher, defaultCodeBase, testPluginCache, new FileHelper()) @@ -65,7 +65,7 @@ protected InProcDataCollectionExtensionManager(string runSettings, ITestEventsPu this.fileHelper = fileHelper; this.codeBasePaths = new List { this.defaultCodeBase }; - // Get Datacollector codebase paths from test plugin cache + // Get Datacollector code base paths from test plugin cache var extensionPaths = testPluginCache.GetExtensionPaths(DataCollectorEndsWithPattern); foreach (var extensionPath in extensionPaths) { @@ -86,12 +86,12 @@ protected InProcDataCollectionExtensionManager(string runSettings, ITestEventsPu } /// - /// Gets a value indicating whether is in proc data collection enabled. + /// Gets a value indicating whether is in-proc data collection enabled. /// public bool IsInProcDataCollectionEnabled { get; private set; } /// - /// Creates data collector instance based on datacollector settings provided. + /// Creates data collector instance based on datacollector settings provided. /// /// /// Settings to be used for creating DataCollector. @@ -192,7 +192,7 @@ private void TriggerUpdateTestResult(object sender, TestResultEventArgs e) } /// - /// Loads all the inproc data collector dlls + /// Loads all the in-proc data collector dlls /// /// /// The run Settings. @@ -200,7 +200,7 @@ private void TriggerUpdateTestResult(object sender, TestResultEventArgs e) private void InitializeInProcDataCollectors(string runSettings) { try - { + { // Check if runsettings contains in-proc datacollector element var inProcDataCollectionRunSettings = XmlRunSettingsUtilities.GetInProcDataCollectionRunSettings(runSettings); var inProcDataCollectionSettingsPresentInRunSettings = inProcDataCollectionRunSettings?.IsCollectionEnabled ?? false; @@ -209,7 +209,7 @@ private void InitializeInProcDataCollectors(string runSettings) inProcDataCollectionSettingsPresentInRunSettings = inProcDataCollectionSettingsPresentInRunSettings && inProcDataCollectionRunSettings.DataCollectorSettingsList.Any(); - // Initialize if we have atleast one + // Initialize if we have at least one if (inProcDataCollectionSettingsPresentInRunSettings) { this.inProcDataCollectorSettingsCollection = inProcDataCollectionRunSettings.DataCollectorSettingsList; @@ -227,7 +227,7 @@ private void InitializeInProcDataCollectors(string runSettings) } catch (Exception ex) { - EqtTrace.Error("InProcDataCollectionExtensionManager: Error occured while Initializing the datacollectors : {0}", ex); + EqtTrace.Error("InProcDataCollectionExtensionManager: Error occurred while Initializing the datacollectors : {0}", ex); } finally { @@ -236,11 +236,11 @@ private void InitializeInProcDataCollectors(string runSettings) } /// - /// Gets codebase for inproc datacollector + /// Gets code base for in-proc datacollector /// Uses all codebasePaths to check where the datacollector exists /// - /// The codebase. - /// Codebase + /// The code base. + /// Code base private string GetCodebase(string codeBase) { if (!Path.IsPathRooted(codeBase)) @@ -276,7 +276,7 @@ private void TriggerInProcDataCollectionMethods(string methodName, InProcDataCol } catch (Exception ex) { - EqtTrace.Error("InProcDataCollectionExtensionManager: Error occured while Triggering the {0} method : {1}", methodName, ex); + EqtTrace.Error("InProcDataCollectionExtensionManager: Error occurred while Triggering the {0} method : {1}", methodName, ex); } } @@ -331,12 +331,12 @@ internal static class Constants public const string TestSourcesPropertyName = "TestSources"; /// - /// Coverlet inproc data collector codebase + /// Coverlet in-proc data collector code base /// public const string CoverletDataCollectorCodebase = "coverlet.collector.dll"; /// - /// Coverlet inproc data collector type name + /// Coverlet in-proc data collector type name /// public const string CoverletDataCollectorTypeName = "Coverlet.Collector.DataCollection.CoverletInProcDataCollector"; } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionSink.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionSink.cs index fab0dcf9e6..e00510544c 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionSink.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionSink.cs @@ -91,7 +91,7 @@ internal void AddOrUpdateData(string key, string value) { if (EqtTrace.IsWarningEnabled) { - EqtTrace.Warning("The data for inprocdata collector with key {0} has already been set. Will be reset with new value", key); + EqtTrace.Warning("The data for in-proc data collector with key {0} has already been set. Will be reset with new value", key); } this.CollectionData[key] = value; } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs index 140750b6bd..bb35cc9cb7 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs @@ -74,7 +74,7 @@ internal InProcDataCollector(string codeBase, string assemblyQualifiedName, Type if (Path.GetFileName(codeBase) == Constants.CoverletDataCollectorCodebase) { // If we're loading coverlet collector we skip to check the version of assembly - // to allow upgrade throught nuget package + // to allow upgrade through nuget package filterPredicate = (x) => x.FullName.Equals(Constants.CoverletDataCollectorTypeName) && interfaceTypeInfo.IsAssignableFrom(x.GetTypeInfo()); // Coverlet collector is consumed as nuget package we need to add assemblies directory to resolver to correctly load references. @@ -150,7 +150,7 @@ private static object CreateObjectFromType(Type type) } /// - /// Loads the assembly into the default context based on the codebase path + /// Loads the assembly into the default context based on the code base path /// /// /// @@ -164,7 +164,7 @@ private Assembly LoadInProcDataCollectorExtension(string codeBase) catch (Exception ex) { EqtTrace.Error( - "InProcDataCollectionExtensionManager: Error occured while loading the InProcDataCollector : {0} , Exception Details : {1}", codeBase, ex); + "InProcDataCollectionExtensionManager: Error occurred while loading the InProcDataCollector : {0} , Exception Details : {1}", codeBase, ex); } return assembly; diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ParallelDataCollectionEventsHandler.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ParallelDataCollectionEventsHandler.cs index 3a1ea1dd38..3a3a1ed7d5 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ParallelDataCollectionEventsHandler.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ParallelDataCollectionEventsHandler.cs @@ -53,7 +53,7 @@ public override void HandleTestRunComplete( if (parallelRunComplete) { - // todo: use TestPluginCache to iterate over all IDataCollectorAttachments + // TODO : use TestPluginCache to iterate over all IDataCollectorAttachments { var coverageHandler = new CodeCoverageDataAttachmentsHandler(); Uri attachementUri = coverageHandler.GetExtensionUri(); diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyDataCollectionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyDataCollectionManager.cs index 6db9313a6c..e7d1fce7c3 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyDataCollectionManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyDataCollectionManager.cs @@ -216,7 +216,7 @@ public void TestHostLaunched(int processId) /// public void Dispose() { - EqtTrace.Info("ProxyDataCollectionManager.Dispose: calling dospose for datacollector processId: {0} port: {1}", this.dataCollectionProcessId, this.dataCollectionPort); + EqtTrace.Info("ProxyDataCollectionManager.Dispose: calling dispose for datacollector processId: {0} port: {1}", this.dataCollectionProcessId, this.dataCollectionPort); this.dataCollectionRequestSender.Close(); } @@ -340,7 +340,7 @@ private string GetTimestampedLogFile(string logFile) } /// - /// Update Extensions path folder in testadapterspaths in runsettings. + /// Update Extensions path folder in test adapters paths in runsettings. /// /// private static string UpdateExtensionsFolderInRunSettings(string settingsXml) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs index 48666d0c3d..690605a265 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs @@ -110,7 +110,7 @@ public void LoadTests(IDictionary> testExtensionSour } /// - /// Loads test cases from individual source. + /// Loads test cases from individual source. /// Discovery extensions update progress through ITestCaseDiscoverySink. /// Discovery extensions sends discovery messages through TestRunMessageLoggerProxy /// @@ -332,7 +332,7 @@ private void SetAdapterLoggingSettings(IMessageLogger messageLogger, IRunSetting if (discoveryMessageLogger != null && runSettings != null) { #if Todo - // Todo: Enable this when RunSettings is enabled. + // TODO : Enable this when RunSettings is enabled. IRunConfigurationSettingsProvider runConfigurationSettingsProvider = (IRunConfigurationSettingsProvider)runSettings.GetSettings(ObjectModel.Constants.RunConfigurationSettingsName); if (runConfigurationSettingsProvider != null @@ -386,7 +386,7 @@ internal static Dictionary /// Sources. /// Assembly type. - /// Sources with mathcing assembly type. + /// Sources with matching assembly type. private static IDictionary> GetAssemblyTypeToSoucesMap(IEnumerable sources, IAssemblyProperties assemblyProperties) { var assemblyTypeToSoucesMap = new Dictionary>() @@ -485,7 +485,7 @@ private static IEnumerable - /// The Serializer to clone testcase object incase of user input test source is package. E.g UWP scenario(appx/build.appxrecipe). + /// The Serializer to clone testcase object in case of user input test source is package. E.g UWP scenario(appx/build.appxrecipe). /// private IDataSerializer dataSerializer; @@ -244,7 +244,7 @@ public void RunTests() EqtTrace.Error("BaseRunTests.RunTests: Failed to raise runCompletion error. Reason: {0}.", ex2); } - // TODO: this does not crash the process currently because of the job queue. + // TODO : this does not crash the process currently because of the job queue. // Let the process crash throw; } @@ -266,7 +266,7 @@ internal void Abort() internal void Cancel() { // Note: Test host delegates the cancellation to active executor and doesn't call HandleTestRunComplete in cancel request. - // Its expected from active executor to respect the cancel request and thus return from RunTests quickly (cancelling the tests). + // Its expected from active executor to respect the cancel request and thus return from RunTests quickly (canceling the tests). this.isCancellationRequested = true; if (this.activeExecutor == null) @@ -518,7 +518,7 @@ private TestExecutorExtensionManager GetExecutorExtensionManager(string extensio catch (Exception ex) { EqtTrace.Error( - "BaseRunTests: GetExecutorExtensionManager: Exception occured while loading extensions {0}", + "BaseRunTests: GetExecutorExtensionManager: Exception occurred while loading extensions {0}", ex); return null; diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs index 25b0dd299e..07f2b18221 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs @@ -209,17 +209,17 @@ private void LoadExtensions() { if (EqtTrace.IsWarningEnabled) { - EqtTrace.Warning("TestExecutorWebService: Exception occured while calling test connection. {0}", ex); + EqtTrace.Warning("TestExecutorWebService: Exception occurred while calling test connection. {0}", ex); } } } /// - /// Initializes outproc and inproc data collectors. + /// Initializes out-proc and in-proc data collectors. /// private void InitializeDataCollectors(string runSettings, ITestEventsPublisher testEventsPublisher, string defaultCodeBase) { - // Initialize outproc data collectors if declared in run settings. + // Initialize out-proc data collectors if declared in run settings. if (DataCollectionTestCaseEventSender.Instance != null && XmlRunSettingsUtilities.IsDataCollectionEnabled(runSettings)) { var outOfProcDataCollectionManager = new ProxyOutOfProcDataCollectionManager(DataCollectionTestCaseEventSender.Instance, testEventsPublisher); diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/TestRunCache.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/TestRunCache.cs index e3d4d93981..02c177f175 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/TestRunCache.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/TestRunCache.cs @@ -383,7 +383,7 @@ private void OnCacheTimeHit(object state) { if (EqtTrace.IsErrorEnabled) { - EqtTrace.Error("TestRunCache: OnCacheTimeHit: Exception occured while checking for cache hit. {0}", ex); + EqtTrace.Error("TestRunCache: OnCacheTimeHit: Exception occurred while checking for cache hit. {0}", ex); } } } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs index e9fb6bc300..b3e99e71ac 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs @@ -231,7 +231,7 @@ private int VerifyParallelSettingAndCalculateParallelLevel(int sourceCount, stri } catch (Exception ex) { - EqtTrace.Error("TestEngine: Error occured while initializing ParallelExecution: {0}", ex); + EqtTrace.Error("TestEngine: Error occurred while initializing ParallelExecution: {0}", ex); EqtTrace.Warning("TestEngine: Defaulting to Sequential Execution"); parallelLevelToUse = 1; @@ -261,7 +261,7 @@ private bool ShouldRunInNoIsolation(string runsettings, bool isParallelEnabled, var currentProcessPath = this.processHelper.GetCurrentProcessFileName(); - // If running with the dotnet executable, then dont run in InProcess + // If running with the dotnet executable, then don't run in InProcess if (currentProcessPath.EndsWith("dotnet", StringComparison.OrdinalIgnoreCase) || currentProcessPath.EndsWith("dotnet.exe", StringComparison.OrdinalIgnoreCase)) { diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameCollector.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameCollector.cs index dbd821b469..c446b2d82e 100644 --- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameCollector.cs +++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameCollector.cs @@ -151,7 +151,7 @@ public override void Initialize( /// /// Disposes of the timer when called to prevent further calls. - /// Kills the other instance of procdump if launched for collecting trigger based dumps. + /// Kills the other instance of proc dump if launched for collecting trigger based dumps. /// Starts and waits for a new proc dump process to collect a single dump and then /// kills the testhost process. /// @@ -472,7 +472,7 @@ private void ResetInactivityTimer() } /// - /// Method to deregister handlers and cleanup + /// Method to de-register handlers and cleanup /// private void DeregisterEvents() { diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Constants.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Constants.cs index 5845683618..219cb5271b 100644 --- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Constants.cs +++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Constants.cs @@ -54,12 +54,12 @@ internal static class Constants public const string DumpModeKey = "CollectDump"; /// - /// Procdump 32 bit version + /// Proc dump 32 bit version /// public const string ProcdumpProcess = "procdump.exe"; /// - /// Procdump 64 bit version + /// Proc dump 64 bit version /// public const string Procdump64Process = "procdump64.exe"; diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Interfaces/IProcessDumpUtility.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Interfaces/IProcessDumpUtility.cs index b746432a6f..f1c56abb08 100644 --- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Interfaces/IProcessDumpUtility.cs +++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Interfaces/IProcessDumpUtility.cs @@ -14,7 +14,7 @@ public interface IProcessDumpUtility string GetDumpFile(); /// - /// Launch procdump process + /// Launch proc dump process /// /// /// Process ID of test host @@ -31,7 +31,7 @@ public interface IProcessDumpUtility void StartTriggerBasedProcessDump(int processId, string dumpFileGuid, string testResultsDirectory, bool isFullDump = false); /// - /// Launch procdump process to capture dump in case of a testhost hang and wait for it to exit + /// Launch proc dump process to capture dump in case of a testhost hang and wait for it to exit /// /// /// Process ID of test host diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessDumpUtility.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessDumpUtility.cs index b3c3c74c3a..fbbb973ae9 100644 --- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessDumpUtility.cs +++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessDumpUtility.cs @@ -81,7 +81,7 @@ public string GetDumpFile() EqtTrace.Error("ProcessDumpUtility.GetDumpFile: No dump file generated."); if (this.processHelper.TryGetExitCode(this.procDumpProcess, out exitCode)) { - EqtTrace.Error("ProcessDumpUtility.GetDumpFile: Procdump exited with code: {0}", exitCode); + EqtTrace.Error("ProcessDumpUtility.GetDumpFile: Proc dump exited with code: {0}", exitCode); } } @@ -102,7 +102,7 @@ public void StartTriggerBasedProcessDump(int processId, string dumpFileGuid, str if (EqtTrace.IsInfoEnabled) { - EqtTrace.Info($"ProcessDumpUtility : The procdump argument is {procDumpArgs}"); + EqtTrace.Info($"ProcessDumpUtility : The proc dump argument is {procDumpArgs}"); } this.procDumpProcess = this.processHelper.LaunchProcess( @@ -128,7 +128,7 @@ public void StartHangBasedProcessDump(int processId, string dumpFileGuid, string if (EqtTrace.IsInfoEnabled) { - EqtTrace.Info($"ProcessDumpUtility : The hang based procdump invocation argument is {procDumpArgs}"); + EqtTrace.Info($"ProcessDumpUtility : The hang based proc dump invocation argument is {procDumpArgs}"); } this.procDumpProcess = this.processHelper.LaunchProcess( @@ -162,12 +162,12 @@ public void TerminateProcess() } /// - /// Get procdump executable path + /// Get proc dump executable path /// /// /// Process Id /// - /// procdump executable path + /// proc dump executable path private string GetProcDumpExecutable(int processId) { var procdumpPath = Environment.GetEnvironmentVariable("PROCDUMP_PATH"); @@ -176,7 +176,7 @@ private string GetProcDumpExecutable(int processId) { string filename = string.Empty; - // Launch procdump according to process architecture + // Launch proc dump according to process architecture if (this.environment.Architecture == PlatformArchitecture.X86) { filename = Constants.ProcdumpProcess; @@ -191,7 +191,7 @@ private string GetProcDumpExecutable(int processId) if (EqtTrace.IsVerboseEnabled) { - EqtTrace.Verbose("Using procdump at: {0}", procDumpExe); + EqtTrace.Verbose("Using proc dump at: {0}", procDumpExe); } return procDumpExe; diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Interfaces/XmlTestStoreParameters.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Interfaces/XmlTestStoreParameters.cs index aa086638b4..f89b6e93ea 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Interfaces/XmlTestStoreParameters.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Interfaces/XmlTestStoreParameters.cs @@ -14,7 +14,7 @@ namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel /// Example: a class has a summary and details fields. Details are large, so they're only /// saved when 'MyClass.SaveDetails' parameter is set to 'true'. /// - [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed. Suppression is OK here.")] + [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed. Suppression is ok here.")] internal sealed class XmlTestStoreParameters : Dictionary { private XmlTestStoreParameters() diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestCategoryItems.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestCategoryItems.cs index 14ffe14426..273195e97c 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestCategoryItems.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestCategoryItems.cs @@ -85,7 +85,7 @@ public override bool Equals(object other) /// /// Convert the category name to a hashcode /// - /// Hashcode of the cagegory. + /// Hashcode of the category. public override int GetHashCode() { Debug.Assert(this.category != null, "category is null"); @@ -198,7 +198,7 @@ public override string ToString() /// /// Convert the TestCategoryItemCollection to an array of strings. /// - /// Array of strings containing the test cagegories. + /// Array of strings containing the test categories. public string[] ToArray() { string[] result = new string[this.Count]; diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestRunSummary.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestRunSummary.cs index b097f9ee60..d0e95888b0 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestRunSummary.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestRunSummary.cs @@ -16,75 +16,75 @@ internal class TestRunSummary : IXmlTestStore { #region Fields - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@total")] private int totalTests; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@executed")] private int executedTests; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@passed")] private int passedTests; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@failed")] private int failedTests; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@error")] private int errorTests; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@timeout")] private int timeoutTests; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@aborted")] private int abortedTests; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@inconclusive")] private int inconclusiveTests; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@passedButRunAborted")] private int passedButRunAborted; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@notRunnable")] private int notRunnable; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@notExecuted")] private int notExecuted; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@disconnected")] private int disconnected; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@warning")] private int warning; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@completed")] private int completed; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@inProgress")] private int inProgress; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Counters/@pending")] private int pending; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField] private TestOutcome outcome = TestOutcome.Pending; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is OK here.")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Reviewed. Suppression is ok here.")] [StoreXmlSimpleField("Output/StdOut", "")] private string stdOut = string.Empty; diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs index 121db656c1..0bb0dddd23 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs @@ -96,7 +96,7 @@ protected TrxLogger(IFileHelper fileHelper) private Dictionary parametersDictionary; /// - /// Gets the directory under which default trx file and test results attachements should be saved. + /// Gets the directory under which default trx file and test results attachments should be saved. /// private string testResultsDirPath; @@ -267,7 +267,7 @@ internal void TestResultHandler(object sender, ObjectModel.Logging.TestResultEve if (this.testRun == null) CreateTestRun(); - // Convert skipped test to a log entry as that is the behaviour of mstest. + // Convert skipped test to a log entry as that is the behavior of mstest. if (e.Result.Outcome == ObjectModel.TestOutcome.Skipped) this.HandleSkippedTest(e.Result); @@ -299,7 +299,7 @@ internal void TestResultHandler(object sender, ObjectModel.Logging.TestResultEve // Update test entries UpdateTestEntries(executionId, parentExecutionId, testElement, parentTestElement); - // Set various counts (passtests, failed tests, total tests) + // Set various counts (passed tests, failed tests, total tests) this.totalTests++; if (testResult.Outcome == TrxLoggerObjectModel.TestOutcome.Failed) { @@ -395,7 +395,7 @@ internal void TestRunCompleteHandler(object sender, TestRunCompleteEventArgs e) } /// - /// populate trx file from the xmlelement + /// populate trx file from the xml element /// /// /// Trx full path @@ -537,7 +537,7 @@ private void CreateTestRun() // We cannot rely on the StartTime for the first test result // In case of parallel, first test result is the fastest test and not the one which started first. - // Setting Started to DateTime.Now in Intialize will make sure we include the startup cost, which was being ignored earlier. + // Setting Started to DateTime.Now in Initialize will make sure we include the startup cost, which was being ignored earlier. // This is in parity with the way we set this.testRun.Finished this.testRun.Started = this.testRunStartTime; diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Converter.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Converter.cs index f91f8c5b74..98a6b2a332 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Converter.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Converter.cs @@ -113,7 +113,7 @@ public ITestResult ToTestResult( if (rockSteadyTestResult.Duration != null) testResult.Duration = rockSteadyTestResult.Duration; - // Clear exsting messages and store rocksteady result messages. + // Clear existing messages and store rocksteady result messages. testResult.TextMessages = null; UpdateResultMessages(testResult, rockSteadyTestResult); @@ -395,7 +395,7 @@ private void UpdateTestResultAttachments(ObjectModel.TestResult rockSteadyTestRe { try { - // If the attachement is from data collector + // If the attachment is from data collector if (attachmentSet.Uri.AbsoluteUri.StartsWith(Constants.DataCollectorUriPrefix, StringComparison.OrdinalIgnoreCase)) { CollectorDataEntry collectorEntry = ToCollectorEntry(attachmentSet, testResult.Id.ExecutionId, testRun, trxFileDirectory); @@ -636,11 +636,11 @@ private string GetTestClassName(string testName, string fullyQualifiedName, stri { className = nameToCheck.Substring(0, nameToCheck.LastIndexOf("::")); - // rename for a consistent behaviour for all tests. + // rename for a consistent behavior for all tests. return className.Replace("::", "."); } - // Ordered test, web test scenario (Setting class name as source name if FQDn doesnt have . or ::) + // Ordered test, web test scenario (Setting class name as source name if FQDn doesn't have . or ::) try { string testCaseSource = Path.GetFileNameWithoutExtension(source); diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/FileHelper.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/FileHelper.cs index 9a043e1d7c..d103506a7d 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/FileHelper.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/FileHelper.cs @@ -50,7 +50,7 @@ static FileHelper() InvalidFileNameChars.Add(c, null); } - // Needed becuase when kicking off qtsetup.bat cmd.exe is used. '@' is a special character + // Needed because when kicking off qtsetup.bat cmd.exe is used. '@' is a special character // for cmd so must be removed from the path to the bat file AdditionalInvalidFileNameChars = new Dictionary(5); AdditionalInvalidFileNameChars.Add('@', null); diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/Attributes.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/Attributes.cs index d6d125c48d..16c91d8f4a 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/Attributes.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/Attributes.cs @@ -15,8 +15,8 @@ internal abstract class StoreXmlAttribute : Attribute /// /// simple xpath location. only element and attribute names can be used. /// - [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:AccessibleFieldsMustBeginWithUpperCaseLetter", Justification = "Reviewed. Suppression is OK here.")] - [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Reviewed. Suppression is OK here.")] + [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:AccessibleFieldsMustBeginWithUpperCaseLetter", Justification = "Reviewed. Suppression is ok here.")] + [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Reviewed. Suppression is ok here.")] public string Location; /// @@ -44,8 +44,8 @@ public StoreXmlAttribute(string location) [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] internal sealed class StoreXmlSimpleFieldAttribute : StoreXmlAttribute { - [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] - [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Reviewed. Suppression is OK here.")] + [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is ok here.")] + [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Reviewed. Suppression is ok here.")] public object DefaultValue; /// @@ -100,7 +100,7 @@ internal sealed class StoreXmlFieldAttribute : StoreXmlAttribute /// /// If there's no xml for the field a default instance is created or not. /// - [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Reviewed. Suppression is OK here.")] + [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Reviewed. Suppression is ok here.")] public bool CreateDefaultInstance = CreateDefaultInstanceDefault; /// diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/XmlPersistence.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/XmlPersistence.cs index 2332edf5cc..44b3a53cb0 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/XmlPersistence.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/XML/XmlPersistence.cs @@ -111,7 +111,7 @@ public object Key /// - /// Optimization: avoid reparsing same query multiple times + /// Optimization: avoid re-parsing same query multiple times /// private static Dictionary queryCache = new Dictionary(); @@ -582,7 +582,7 @@ private static string DateTimeToString(DateTime dateTime) else { // Ensure that the datetime value is in local time.. - // This is needed as the persistenceformat we use needs the datetime to be in local time.. + // This is needed as the persistence format we use needs the datetime to be in local time.. DateTime localDateTime = dateTime.ToLocalTime(); return localDateTime.ToString(DateTimePersistenceFormat, CultureInfo.InvariantCulture.DateTimeFormat); } @@ -837,7 +837,7 @@ private XmlNode LocationToXmlNode(XmlElement element, string location) } catch (System.Xml.XPath.XPathException e) { - throw new Exception("The persistance location is invalid. Element: '" + element.Name + "', location: '" + location + "'", e); + throw new Exception("The persistence location is invalid. Element: '" + element.Name + "', location: '" + location + "'", e); } } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Adapter/TestPlatformFormatException.cs b/src/Microsoft.TestPlatform.ObjectModel/Adapter/TestPlatformFormatException.cs index 51104d0384..329ab83d21 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Adapter/TestPlatformFormatException.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Adapter/TestPlatformFormatException.cs @@ -61,7 +61,7 @@ public TestPlatformFormatException(string message, Exception innerException) #if NET451 /// - /// Seralization constructor. + /// Serialization constructor. /// protected TestPlatformFormatException(SerializationInfo info, StreamingContext context) : base(info, context) diff --git a/src/Microsoft.TestPlatform.ObjectModel/Adapter/TestsCanceledException.cs b/src/Microsoft.TestPlatform.ObjectModel/Adapter/TestsCanceledException.cs index 6769a73bae..8f138573c9 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Adapter/TestsCanceledException.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Adapter/TestsCanceledException.cs @@ -48,7 +48,7 @@ public TestCanceledException(string message, Exception innerException) #if NET451 /// - /// Seralization constructor. + /// Serialization constructor. /// protected TestCanceledException(SerializationInfo info, StreamingContext context) : base(info, context) diff --git a/src/Microsoft.TestPlatform.ObjectModel/AttachmentSet.cs b/src/Microsoft.TestPlatform.ObjectModel/AttachmentSet.cs index c9291c3fce..0108cac3f2 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/AttachmentSet.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/AttachmentSet.cs @@ -62,7 +62,7 @@ public class UriDataAttachment public string Description { get; private set; } /// - /// Uri of the attchment. + /// Uri of the attachment. /// [DataMember] public Uri Uri { get; private set; } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Events/TestRunCompleteEventArgs.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Events/TestRunCompleteEventArgs.cs index bd5015c809..85f87a48fa 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/Events/TestRunCompleteEventArgs.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Events/TestRunCompleteEventArgs.cs @@ -67,7 +67,7 @@ public TestRunCompleteEventArgs(ITestRunStatistics stats, bool isCanceled, bool /// /// Gets the time elapsed in just running the tests. - /// Value is set to TimeSpan.Zero incase of any error. + /// Value is set to TimeSpan.Zero in case of any error. /// [DataMember] public TimeSpan ElapsedTimeInRunningTests { get; private set; } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/TestRunState.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/TestRunState.cs index ebf93d5cae..4016fa14a0 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/TestRunState.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/TestRunState.cs @@ -29,7 +29,7 @@ public enum TestRunState Completed = 3, /// - /// Run is canceled and remaing tests have been aborted + /// Run is canceled and remaining tests have been aborted /// Canceled = 4, diff --git a/src/Microsoft.TestPlatform.ObjectModel/ConnectionInfo/TestRunnerConnectionInfo.cs b/src/Microsoft.TestPlatform.ObjectModel/ConnectionInfo/TestRunnerConnectionInfo.cs index 52364a369e..98d812c488 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/ConnectionInfo/TestRunnerConnectionInfo.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/ConnectionInfo/TestRunnerConnectionInfo.cs @@ -4,13 +4,13 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel { /// - /// Details of EndPoint address for connection b/w test runtime, test runnner + /// Details of EndPoint address for connection b/w test runtime, test runner /// public struct TestHostConnectionInfo { /// /// Endpoint where the service is hosted, This endpoint is specific to Transport - /// e.g. 127.0.0.0:8080 for socktes + /// e.g. 127.0.0.0:8080 for sockets /// public string Endpoint { @@ -28,7 +28,7 @@ public ConnectionRole Role } /// - /// Gets or sets the trasport protocol supported by test runtime + /// Gets or sets the transport protocol supported by test runtime /// public Transport Transport { diff --git a/src/Microsoft.TestPlatform.ObjectModel/Constants.cs b/src/Microsoft.TestPlatform.ObjectModel/Constants.cs index 0c326c8486..15cc686f07 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Constants.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Constants.cs @@ -188,7 +188,7 @@ public static class Constants #endif /// - /// Contants for detecting .net framework. + /// Constants for detecting .net framework. /// public const string TargetFrameworkAttributeFullName = "System.Runtime.Versioning.TargetFrameworkAttribute"; @@ -216,7 +216,7 @@ public static class Constants /// public static class DefaultLoggerParameterNames { - // Denotes target location for test run resutls + // Denotes target location for test run results // For ex. TrxLogger saves test run results at this target public const string TestRunDirectory = "TestRunDirectory"; diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/FileHelper.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/FileHelper.cs index 3ca802b816..c4d8ec9f80 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/FileHelper.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/FileHelper.cs @@ -62,7 +62,7 @@ public static bool IsValidFileName(string fileName, out string invalidCharacters /// /// Returns true if the file name specified is Windows reserved file name. /// - /// The name of the file. Note: only a file name, does not expect to contain dir separators. + /// The name of the file. Note: only a file name, does not expect to contain directory separators. internal static bool IsReservedFileName(string fileName) { Debug.Assert(!string.IsNullOrEmpty(fileName), "FileHelper.IsReservedFileName: the argument is null or empty string!"); diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/TestCaseFailureType.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/TestCaseFailureType.cs index 0e3653824a..5f50be9872 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/TestCaseFailureType.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/TestCaseFailureType.cs @@ -4,7 +4,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection { /// - /// Type of test case failure which occured. + /// Type of test case failure which occurred. /// public enum TestCaseFailureType { diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionContext.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionContext.cs index 9cdb6a9425..34b00bd336 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionContext.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionContext.cs @@ -59,7 +59,7 @@ protected internal DataCollectionContext(SessionId sessionId) /// or null if no executing test case is in context protected internal DataCollectionContext(SessionId sessionId, TestExecId testExecId) { - //todo + //TODO //EqtAssert.ParameterNotNull(sessionId, "sessionId"); this.sessionId = sessionId; diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/DataCollectionEventArgs.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/DataCollectionEventArgs.cs index 8dc44d12ce..0276ec003c 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/DataCollectionEventArgs.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/DataCollectionEventArgs.cs @@ -55,7 +55,7 @@ public DataCollectionContext Context /// Context to update with. /// /// Generally the data collection context is known in advance, however there - /// are cases around custom notifications where it is not necessiarly known + /// are cases around custom notifications where it is not necessarily known /// until the event is being sent. This is used for updating the context when /// sending the event. /// diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/SessionEvents.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/SessionEvents.cs index d95fb5f66b..2afe61d52e 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/SessionEvents.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/SessionEvents.cs @@ -19,11 +19,11 @@ public sealed class SessionStartEventArgs : DataCollectionEventArgs #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Default constructor with empty properties and default DataCollectionContext. - /// DataCollectionContext with empty session signifies that is it irrelevent in the current context. + /// DataCollectionContext with empty session signifies that is it irrelevant in the current context. /// public SessionStartEventArgs() : this(new DataCollectionContext(new SessionId(Guid.Empty)), new Dictionary()) { @@ -31,11 +31,11 @@ public sealed class SessionStartEventArgs : DataCollectionEventArgs } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// constructor with properties and default DataCollectionContext. - /// DataCollectionContext with empty session signifies that is it irrelevent in the current context. + /// DataCollectionContext with empty session signifies that is it irrelevant in the current context. /// public SessionStartEventArgs(IDictionary properties) : this(new DataCollectionContext(new SessionId(Guid.Empty)), properties) { @@ -43,7 +43,7 @@ public SessionStartEventArgs(IDictionary properties) : this(new } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Context information for the session @@ -107,11 +107,11 @@ public sealed class SessionEndEventArgs : DataCollectionEventArgs #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Default constructor with default DataCollectionContext. - /// DataCollectionContext with empty session signifies that is it irrelevent in the current context. + /// DataCollectionContext with empty session signifies that is it irrelevant in the current context. /// public SessionEndEventArgs() : this(new DataCollectionContext(new SessionId(Guid.Empty))) { @@ -119,7 +119,7 @@ public SessionEndEventArgs() : this(new DataCollectionContext(new SessionId(Guid } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Context information for the session diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/TestCaseEvents.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/TestCaseEvents.cs index ae0392817b..e976cf80c9 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/TestCaseEvents.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/TestCaseEvents.cs @@ -23,7 +23,7 @@ public TestCaseEventArgs() } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Context information for the test case @@ -50,7 +50,7 @@ protected TestCaseEventArgs( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Context information for the test case @@ -66,11 +66,11 @@ protected TestCaseEventArgs( // NOTE: ONLY USE FOR UNIT TESTING! // This overload is only here for 3rd parties to use for unit testing // their data collectors. Internally we should not be passing the test element - // around in the events as this is extra information that needs to be seralized + // around in the events as this is extra information that needs to be serialized // and the Execution Plugin Manager will fill this in for us before the event // is sent to the data collector when running in a production environment. - // todo + // TODO // EqtAssert.ParameterNotNull(testElement, "testElement"); this.TestElement = testElement; @@ -133,7 +133,7 @@ public TestCase TestElement [DataContract] public sealed class TestCaseStartEventArgs : TestCaseEventArgs { - #region Constructor + #region Constructor /// /// Default constructor for serialization/deserialization @@ -153,7 +153,7 @@ public TestCaseStartEventArgs(TestCase testElement) : this(new DataCollectionCon } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Initializes the instance by storing the given information. /// /// @@ -170,13 +170,13 @@ public TestCaseStartEventArgs( // NOTE: ONLY USE FOR UNIT TESTING! // This overload is only here for 3rd parties to use for unit testing // their data collectors. Internally we should not be passing the test element - // around in the events as this is extra information that needs to be seralized + // around in the events as this is extra information that needs to be serialized // and the Execution Plugin Manager will fill this in for us before the event // is sent to the data collector when running in a production environment. } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Initializes the instance by storing the given information /// /// @@ -229,14 +229,14 @@ public TestCaseEndEventArgs() /// /// /// Default constructor with default DataCollectionContext. - /// DataCollectionContext with empty session signifies that is it irrelevent in the current context. + /// DataCollectionContext with empty session signifies that is it irrelevant in the current context. /// public TestCaseEndEventArgs(TestCase testElement, TestOutcome testOutcome) : this(new DataCollectionContext(new SessionId(Guid.Empty)), testElement, testOutcome) { } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Initializes the instance by storing the given information. /// /// @@ -257,14 +257,14 @@ public TestCaseEndEventArgs( // NOTE: ONLY USE FOR UNIT TESTING! // This overload is only here for 3rd parties to use for unit testing // their data collectors. Internally we should not be passing the test element - // around in the events as this is extra information that needs to be seralized + // around in the events as this is extra information that needs to be serialized // and the Execution Plugin Manager will fill this in for us before the event // is sent to the data collector when running in a production environment. this.TestOutcome = testOutcome; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Context information for the test case @@ -288,7 +288,7 @@ internal TestCaseEndEventArgs( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Initializes the instance by storing the given information /// /// @@ -357,7 +357,7 @@ public TestResultEventArgs() /// /// /// Default constructor with default DataCollectionContext. - /// DataCollectionContext with empty session signifies that is it irrelevent in the current context. + /// DataCollectionContext with empty session signifies that is it irrelevant in the current context. /// public TestResultEventArgs(TestResult testResult) : this(new DataCollectionContext(new SessionId(Guid.Empty)), testResult) @@ -365,7 +365,7 @@ public TestResultEventArgs(TestResult testResult) } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Initializes the instance by storing the given information. /// /// @@ -382,14 +382,14 @@ public TestResultEventArgs( // NOTE: ONLY USE FOR UNIT TESTING! // This overload is only here for 3rd parties to use for unit testing // their data collectors. Internally we should not be passing the test element - // around in the events as this is extra information that needs to be seralized + // around in the events as this is extra information that needs to be serialized // and the Execution Plugin Manager will fill this in for us before the event // is sent to the data collector when running in a production environment. this.TestResult = testResult; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Initializes the instance by storing the given information /// /// diff --git a/src/Microsoft.TestPlatform.ObjectModel/ExceptionConverter.cs b/src/Microsoft.TestPlatform.ObjectModel/ExceptionConverter.cs index 5a22678d0b..1ce23705e6 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/ExceptionConverter.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/ExceptionConverter.cs @@ -36,7 +36,7 @@ public static class ExceptionConverter /// This method converts WCF fault exception to a strongly-typed exception /// /// FaultException - /// strongly typed excetption that is wrapped in Fault Exception + /// strongly typed exception that is wrapped in Fault Exception [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0")] public static Exception ConvertException(FaultException faultEx) { @@ -49,10 +49,10 @@ public static Exception ConvertException(FaultException faultEx) } /// - /// Creates a strontly-typed exception that is represented by the exception name + /// Creates a strongly-typed exception that is represented by the exception name /// passed as parameter /// - /// Exception type classname + /// Exception type class name /// message of exception /// actual exception that is to be wrapped /// actual exception that is represented by the exception name diff --git a/src/Microsoft.TestPlatform.ObjectModel/Host/ITestRunTimeProvider.cs b/src/Microsoft.TestPlatform.ObjectModel/Host/ITestRunTimeProvider.cs index 7d91515469..187f83e078 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Host/ITestRunTimeProvider.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Host/ITestRunTimeProvider.cs @@ -20,7 +20,7 @@ public interface ITestRuntimeProvider #region events /// /// Raised when host is launched successfully - /// Consumed by TestPlatform to initialize connection b/w test host and testplatform + /// Consumed by TestPlatform to initialize connection b/w test host and test platform /// event EventHandler HostLaunched; @@ -63,7 +63,7 @@ public interface ITestRuntimeProvider void SetCustomLauncher(ITestHostLauncher customLauncher); /// - /// Gets the end point address and behaviour of TestRuntime + /// Gets the end point address and behavior of TestRuntime /// E.g. for phone device EndPoint:127.0.0.1:8080, ConnectionRole Host, TransportProtocol: Sockets /// /// Socket where the service is hosted by TestRuntime @@ -74,7 +74,7 @@ public interface ITestRuntimeProvider /// /// Start parameters for the test host. /// - /// Returns whether the test host lauched successfully or not. + /// Returns whether the test host launched successfully or not. Task LaunchTestHostAsync(TestProcessStartInfo testHostStartInfo, CancellationToken cancellationToken); /// diff --git a/src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerSettings.cs b/src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerSettings.cs index 5a6d9a1689..21952d1823 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerSettings.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerSettings.cs @@ -177,7 +177,7 @@ internal static LoggerSettings FromXml(XmlReader reader) } } - // Check for required atttributes. + // Check for required attributes. if (string.IsNullOrWhiteSpace(settings.FriendlyName) && string.IsNullOrWhiteSpace(settings.Uri?.ToString()) && string.IsNullOrWhiteSpace(settings.AssemblyQualifiedName)) diff --git a/src/Microsoft.TestPlatform.ObjectModel/Logging/Events/DataCollectionMessageEventArgs.cs b/src/Microsoft.TestPlatform.ObjectModel/Logging/Events/DataCollectionMessageEventArgs.cs index f3ed66d85c..d5332da80b 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Logging/Events/DataCollectionMessageEventArgs.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Logging/Events/DataCollectionMessageEventArgs.cs @@ -9,10 +9,10 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging /// /// EventArg used for raising data collector message event. /// - [DataContract] + [DataContract] public class DataCollectionMessageEventArgs : TestRunMessageEventArgs { - #region constructor + #region Constructor /// /// Constructor /// @@ -22,8 +22,8 @@ public DataCollectionMessageEventArgs(TestMessageLevel level, string message) : { } #endregion - - #region properties + + #region Properties /// /// Friendly name of collector @@ -55,7 +55,7 @@ public Guid TestCaseId get; set; } - + #endregion } } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/DiaNavigationData.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/DiaNavigationData.cs index 51485650f4..c20fb49dad 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/DiaNavigationData.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/DiaNavigationData.cs @@ -9,7 +9,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel using Microsoft.VisualStudio.TestPlatform.ObjectModel.Navigation; /// - /// A struct that stores the infomation needed by the navigation: file name, line number, column number. + /// A struct that stores the information needed by the navigation: file name, line number, column number. /// [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Dia is a specific name.")] public class DiaNavigationData : INavigationData diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/FullSymbolReader.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/FullSymbolReader.cs index 82cae88507..3446cad579 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/FullSymbolReader.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/FullSymbolReader.cs @@ -23,13 +23,13 @@ internal class FullSymbolReader : ISymbolReader private IDiaSession session; /// - /// Holds type symbols avaiable in the source. + /// Holds type symbols available in the source. /// private Dictionary typeSymbols = new Dictionary(); /// /// Holds method symbols for all types in the source. - /// Methods in different types can have same name, hence seprated dicitionary is created for each type. + /// Methods in different types can have same name, hence separated dictionary is created for each type. /// Bug: Method overrides in same type are not handled (not a regression) /// ToDo(Solution): Use method token along with as identifier, this will always give unique method.The adapters would need to send this token to us to correct the behavior. /// @@ -83,7 +83,7 @@ public void CacheSymbols(string binaryPath, string searchPath) /// /// /// . - /// Returns INavigationData which contains filename and linenumber. + /// Returns INavigationData which contains filename and line number. /// public INavigationData GetNavigationData(string declaringTypeName, string methodName) { diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/ISymbolReader.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/ISymbolReader.cs index 3374cb800d..c593d7f317 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/ISymbolReader.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/ISymbolReader.cs @@ -9,7 +9,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Navigation using System.Threading.Tasks; /// - /// Caches filename and linenumber for symbols in assembly. + /// Caches filename and line number for symbols in assembly. /// internal interface ISymbolReader : IDisposable { diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortablePdbReader.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortablePdbReader.cs index e91f5abf50..59e979c9a0 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortablePdbReader.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortablePdbReader.cs @@ -22,13 +22,13 @@ internal class PortablePdbReader : IDisposable /// /// Metadata reader provider from portable pdb stream - /// To get Metadate reader + /// To get Metadata reader /// private MetadataReaderProvider provider; /// /// Metadata reader from portable pdb stream - /// To get method debug info from mehthod info + /// To get method debug info from method info /// private MetadataReader reader; diff --git a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs index 7c266cc847..ec220d0a30 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs @@ -17,7 +17,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel /// public class RunConfiguration : TestRunSettings { - #region private fields + #region Private Fields /// /// Platform architecture which rocksteady should use for discovery/execution diff --git a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/SettingsException.cs b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/SettingsException.cs index b76e9343ed..8199c289f6 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/SettingsException.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/SettingsException.cs @@ -45,7 +45,7 @@ public SettingsException(string message, Exception innerException) #if NET451 /// - /// Seralization constructor. + /// Serialization constructor. /// protected SettingsException(SerializationInfo info, StreamingContext context) : base(info, context) diff --git a/src/Microsoft.TestPlatform.ObjectModel/TestObject.cs b/src/Microsoft.TestPlatform.ObjectModel/TestObject.cs index 7c9547d20f..53309900a0 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/TestObject.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/TestObject.cs @@ -282,7 +282,7 @@ private static object ConvertPropertyFrom(TestProperty property, CultureInfo // Do not try conversion if the object is already of the type we're trying to convert. // Note that typeof(T) may be object in case the value is getting deserialized via the StoreKvpList, however - // the deserializer could have converted it already, hence the runtime type check. + // the de-serializer could have converted it already, hence the runtime type check. if (valueType != null && (valueType.GetTypeInfo().IsAssignableFrom(typeof(T).GetTypeInfo()) || valueType.GetTypeInfo().IsAssignableFrom(value?.GetType().GetTypeInfo()))) { return value; @@ -316,7 +316,7 @@ private static object ConvertPropertyFrom(TestProperty property, CultureInfo } catch (Exception e) { - // some type converters throw strange exceptions (eg: System.Exception by Int32Converter) + // some type converters throw strange exceptions (e.g.: System.Exception by Int32Converter) throw new FormatException(e.Message, e); } } @@ -364,7 +364,7 @@ private static T ConvertPropertyTo(TestProperty property, CultureInfo culture } catch (Exception e) { - // some type converters throw strange exceptions (eg: System.Exception by Int32Converter) + // some type converters throw strange exceptions (e.g.: System.Exception by Int32Converter) throw new FormatException(e.Message, e); } } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyHelper.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyHelper.cs index e289d02ce5..79df51f824 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyHelper.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyHelper.cs @@ -13,7 +13,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; /// - /// Implementation of finding assembly referencies using "managed route", i.e. Assembly.Load. + /// Implementation of finding assembly references using "managed route", i.e. Assembly.Load. /// public static class AssemblyHelper { @@ -22,7 +22,7 @@ public static class AssemblyHelper /// /// Checks whether the source assembly directly references given assembly or not. - /// Only assembly name and publickey token are match. Version is ignored for matching. + /// Only assembly name and public key token are match. Version is ignored for matching. /// Returns null if not able to check if source references assembly. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] @@ -91,7 +91,7 @@ public static class AssemblyHelper /// /// Finds platform and .Net framework version for a given test container. - /// If there is an error while infering this information, defaults (AnyCPU, None) are returned + /// If there is an error while inferring this information, defaults (AnyCPU, None) are returned /// for faulting container. /// /// @@ -314,7 +314,7 @@ internal static Version GetTargetFrameworkVersionFromVersionString(string versio /// /// When test run is targeted for .Net4.0, set target framework of test appdomain to be v4.0. - /// With this done tests would be executed in 4.0 compatiblity mode even when .Net4.5 is installed. + /// With this done tests would be executed in 4.0 compatibility mode even when .Net4.5 is installed. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Failure to set this property should be ignored.")] internal static void SetNETFrameworkCompatiblityMode(AppDomainSetup setup, IRunContext runContext) @@ -327,7 +327,7 @@ internal static void SetNETFrameworkCompatiblityMode(AppDomainSetup setup, IRunC { if (EqtTrace.IsVerboseEnabled) { - EqtTrace.Verbose("AssemblyHelper.SetNETFrameworkCompatiblityMode: setting .NetFramework,Version=v4.0 compatiblity mode."); + EqtTrace.Verbose("AssemblyHelper.SetNETFrameworkCompatiblityMode: setting .NetFramework,Version=v4.0 compatibility mode."); } setup.TargetFrameworkName = Constants.DotNetFramework40; } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs index 2df4e07fdb..0ced1c11e5 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs @@ -20,7 +20,7 @@ internal class AssemblyLoadWorker : MarshalByRefObject /// Get the target dot net framework string for the assembly /// /// Path of the assembly file - /// String representation of the the target dot net framework e.g. .NETFramework,Version=v4.0 + /// String representation of the target dot net framework e.g. .NETFramework,Version=v4.0 public string GetTargetFrameworkVersionStringFromPath(string path) { if (!File.Exists(path)) @@ -55,7 +55,7 @@ public string GetTargetFrameworkVersionStringFromPath(string path) /// Get the target dot net framework string for the assembly /// /// Assembly - /// String representation of the the target dot net framework e.g. .NETFramework,Version=v4.0 + /// String representation of the target dot net framework e.g. .NETFramework,Version=v4.0 internal static string GetTargetFrameworkStringFromAssembly(Assembly assembly) { var dotNetVersion = string.Empty; @@ -131,7 +131,7 @@ public string[] GetReferencedAssemblies(string path) foreach (AssemblyName referencedAssembly in assemblies) { - // Check without version. Only name and publikey token. + // Check without version. Only name and public key token. if (string.Compare(referencedAssembly.Name, referenceAssemblyName, StringComparison.OrdinalIgnoreCase) == 0) { byte[] publicKeyToken1 = referencedAssembly.GetPublicKeyToken(); @@ -237,7 +237,7 @@ public void GetPlatformAndFrameworkSettings(string path, out string procArchType frameworkVersion = a.ImageRuntimeVersion.Substring(0, 4).ToUpperInvariant(); // ImageRuntimeVersion for v4.0 & v4.5 are same and it return v4.0 - // Since there is behaviourial differnece in both its important to differentiate them + // Since there is behavioral difference in both its important to differentiate them // Using TargetFrameworkAttribute for the purpose. if (string.Equals(frameworkVersion, "v4.0", StringComparison.OrdinalIgnoreCase)) { @@ -316,7 +316,7 @@ private static string GetArchitectureForSource(string imagePath) fs.Position = peHeader; UInt32 signature = reader.ReadUInt32(); //peHeaderSignature - // 0x00004550 is the letters "PE" followed by two terminating zeroes. + // 0x00004550 is the letters "PE" followed by two terminating zeros. if (signature != 0x00004550) { validImage = false; @@ -324,7 +324,7 @@ private static string GetArchitectureForSource(string imagePath) if (validImage) { - //Read the image file header header. + //Read the image file header. machine = reader.ReadUInt16(); reader.ReadUInt16(); //NumberOfSections reader.ReadUInt32(); //TimeDateStamp diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/EqtHash.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/EqtHash.cs index 641d3c6edc..ec134ae09c 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/EqtHash.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/EqtHash.cs @@ -19,7 +19,7 @@ public static class EqtHash /// Calculates a hash of the string and copies the first 128 bits of the hash /// to a new Guid. /// - [SuppressMessage("Microsoft.Cryptographic.Standard", "CA5354:SHA1CannotBeUsed", Justification = "Hash Algorithm is used only to gererate unique testcase id.")] + [SuppressMessage("Microsoft.Cryptographic.Standard", "CA5354:SHA1CannotBeUsed", Justification = "Hash Algorithm is used only to generate unique testcase id.")] public static Guid GuidFromString(string data) { Debug.Assert(data != null); diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/FilterHelper.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/FilterHelper.cs index 987c0695d4..9abb7086bc 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/FilterHelper.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/FilterHelper.cs @@ -50,7 +50,7 @@ public static string Escape(string str) /// Converts any escaped characters in the input filter string. /// /// The input string that contains the text to convert. - /// A filter string of characters with any escaped characters converted to their unescaped form. + /// A filter string of characters with any escaped characters converted to their un-escaped form. public static string Unescape(string str) { if (str == null) @@ -76,7 +76,7 @@ public static string Unescape(string str) } } - // Strictly speaking, string to be unescaped shouldn't contain any of the special characters, + // Strictly speaking, string to be un-escaped shouldn't contain any of the special characters, // other than being part of escape sequence, but we will ignore that to avoid additional overhead. builder.Append(currentChar); diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/SuspendCodeCoverage.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/SuspendCodeCoverage.cs index 34b2bbc8f3..5df82777c2 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/SuspendCodeCoverage.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/SuspendCodeCoverage.cs @@ -16,7 +16,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities /// public class SuspendCodeCoverage : IDisposable { - #region private variables + #region Private Variables private const string SuspendCodeCoverageEnvVarName = "__VANGUARD_SUSPEND_INSTRUMENT__"; private const string SuspendCodeCoverageEnvVarTrueValue = "TRUE"; @@ -27,7 +27,7 @@ public class SuspendCodeCoverage : IDisposable /// Whether the object is disposed or not. /// private bool isDisposed = false; - + #endregion /// diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/IO/IStream.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/IO/IStream.cs index 127283bdcc..2dca8f26db 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/IO/IStream.cs +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/IO/IStream.cs @@ -6,12 +6,12 @@ namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces using System.IO; /// - /// Helper class to return plaform specific stream. + /// Helper class to return platform specific stream. /// public interface IStream { /// - /// Returns platrform specific Buffered Stream with desired buffer size. + /// Returns platform specific Buffered Stream with desired buffer size. /// /// Input Stream /// Buffer Size diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/Tracing/IPlatformEqtTrace.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/Tracing/IPlatformEqtTrace.cs index 1f47eb20a0..6e815a4697 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/Tracing/IPlatformEqtTrace.cs +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/Tracing/IPlatformEqtTrace.cs @@ -41,7 +41,7 @@ bool DoNotInitialize /// Initializes the tracing with custom log file and trace level. /// Overrides if any trace is set before. /// - /// Customr log file for trace messages. + /// Custom log file for trace messages. /// Trace level. /// Trace initialized flag. bool InitializeTrace(string customLogFile, PlatformTraceLevel traceLevel); @@ -60,7 +60,7 @@ bool DoNotInitialize string GetLogFile(); /// - /// Sets platfrom specific trace value for tracing verbosity. + /// Sets platform specific trace value for tracing verbosity. /// /// /// The value. @@ -68,7 +68,7 @@ bool DoNotInitialize void SetTraceLevel(PlatformTraceLevel value); /// - /// Gets platfrom specific trace value for tracing verbosity. + /// Gets platform specific trace value for tracing verbosity. /// /// /// The . diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/common/Tracing/PlatformEqtTrace.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/common/Tracing/PlatformEqtTrace.cs index d9c66fbf6b..9e57066fb9 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/common/Tracing/PlatformEqtTrace.cs +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/common/Tracing/PlatformEqtTrace.cs @@ -174,7 +174,7 @@ public bool InitializeTrace(string customLogFile, PlatformTraceLevel platformTra TraceLevel = this.MapPlatformTraceToTrace(platformTraceLevel); Source.Switch.Level = TraceSourceLevelsMap[TraceLevel]; - // Ensure trace is initlized + // Ensure trace is initialized return EnsureTraceIsInitialized(); } @@ -382,7 +382,7 @@ private static string GetProcessName() if (args != null && args.Length != 0) { // Leave the extension if specified, otherwise don't add it (e.g. case a.exe.exe). - // It seems that if .exe suffix is not specified Framework adds .EXE to agrs[0]. + // It seems that if .exe suffix is not specified Framework adds .EXE to args[0]. processName = Path.GetFileName(args[0]); } diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/common/Tracing/RollingFileTraceListener.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/common/Tracing/RollingFileTraceListener.cs index 37f30b30d6..16c5a6d3b1 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/common/Tracing/RollingFileTraceListener.cs +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/common/Tracing/RollingFileTraceListener.cs @@ -116,7 +116,7 @@ private static Encoding GetEncodingWithFallback() internal sealed class StreamWriterRollingHelper : IDisposable { /// - /// Synchronisation lock. + /// Synchronization lock. /// private object synclock = new object(); @@ -229,7 +229,7 @@ public void RollIfNecessary() } /// - /// Updates bookeeping information necessary for rolling, as required by the specified + /// Updates book keeping information necessary for rolling, as required by the specified /// rolling configuration. /// /// true if update was successful, false if an error occurred. diff --git a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/AppxManifestFile.cs b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/AppxManifestFile.cs index 3ac67e6db8..8e68f0c076 100644 --- a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/AppxManifestFile.cs +++ b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/AppxManifestFile.cs @@ -6,7 +6,7 @@ namespace Microsoft.VisualStudio.TestPlatform.DesktopTestHostRuntimeProvider using System.IO; using System.Xml.Linq; - /// Wrapper for an appxmanifest file. + /// Wrapper for an appx manifest file. internal static class AppxManifestFile { /// Gets the app's exe name. diff --git a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs index ee4341f204..36016d8ea2 100644 --- a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs +++ b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs @@ -200,7 +200,7 @@ public IEnumerable GetTestPlatformExtensions(IEnumerable sources public IEnumerable GetTestSources(IEnumerable sources) { // We are doing this specifically for UWP, should we extract it out to some other utility? - // Why? Lets say if we have to do same for someother source extension, would we just add another if check? + // Why? Lets say if we have to do same for some other source extension, would we just add another if check? var uwpSources = sources.Where(source => source.EndsWith(".appxrecipe", StringComparison.OrdinalIgnoreCase)); if (uwpSources.Any()) @@ -341,7 +341,7 @@ private Version GetAndLogFileVersion(string path) /// /// Raises HostLaunched event /// - /// hostprovider event args + /// host provider event args private void OnHostLaunched(HostProviderEventArgs e) { this.HostLaunched.SafeInvoke(this, e, "HostProviderEvents.OnHostLaunched"); @@ -350,7 +350,7 @@ private void OnHostLaunched(HostProviderEventArgs e) /// /// Raises HostExited event /// - /// hostprovider event args + /// host provider event args private void OnHostExited(HostProviderEventArgs e) { if (!this.hostExitedEventRaised) diff --git a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs index 8d55c50e5a..cba287f288 100644 --- a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs +++ b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs @@ -200,7 +200,7 @@ public virtual TestProcessStartInfo GetTestHostProcessStartInfo( } else { - EqtTrace.Verbose("DotnetTestHostmanager: File {0}, doesnot exist", runtimeConfigPath); + EqtTrace.Verbose("DotnetTestHostmanager: File {0}, does not exist", runtimeConfigPath); } // Use the deps.json for test source @@ -213,7 +213,7 @@ public virtual TestProcessStartInfo GetTestHostProcessStartInfo( } else { - EqtTrace.Verbose("DotnetTestHostmanager: File {0}, doesnot exist", depsFilePath); + EqtTrace.Verbose("DotnetTestHostmanager: File {0}, does not exist", depsFilePath); } var runtimeConfigDevPath = Path.Combine(sourceDirectory, string.Concat(sourceFile, ".runtimeconfig.dev.json")); @@ -321,7 +321,7 @@ public IEnumerable GetTestPlatformExtensions(IEnumerable sources /// public IEnumerable GetTestSources(IEnumerable sources) { - // We do not have scenario where netcore tests are deployed to remote machine, so no need to udpate sources + // We do not have scenario where netcore tests are deployed to remote machine, so no need to update sources return sources; } @@ -361,7 +361,7 @@ public Task CleanTestHostAsync(CancellationToken cancellationToken) /// /// Raises HostLaunched event /// - /// hostprovider event args + /// host provider event args private void OnHostLaunched(HostProviderEventArgs e) { this.HostLaunched.SafeInvoke(this, e, "HostProviderEvents.OnHostLaunched"); @@ -370,7 +370,7 @@ private void OnHostLaunched(HostProviderEventArgs e) /// /// Raises HostExited event /// - /// hostprovider event args + /// host provider event args private void OnHostExited(HostProviderEventArgs e) { if (!this.hostExitedEventRaised) @@ -476,7 +476,7 @@ private string GetTestHostPath(string runtimeConfigDevPath, string depsFilePath, errorMessage = string.Format(CultureInfo.CurrentCulture, Resources.UnableToFindDepsFile, depsFilePath); } - // If we are here it means it couldnt resolve testhost.dll from nuget cache. + // If we are here it means it couldn't resolve testhost.dll from nuget cache. // Try resolving testhost from output directory of test project. This is required if user has published the test project // and is running tests in an isolated machine. A second scenario is self test: test platform unit tests take a project // dependency on testhost (instead of nuget dependency), this drops testhost to output path. @@ -485,7 +485,7 @@ private string GetTestHostPath(string runtimeConfigDevPath, string depsFilePath, if (!this.fileHelper.Exists(testHostPath)) { - // If deps file is not found, suggest adding Microsoft.Net.Test.Sdk reference to the project + // If dependency file is not found, suggest adding Microsoft.Net.Test.Sdk reference to the project // Otherwise, suggest publishing the test project so that test host gets dropped next to the test source. errorMessage = errorMessage ?? string.Format(CultureInfo.CurrentCulture, Resources.SuggestPublishTestProject, testHostPath); throw new TestPlatformException(errorMessage); diff --git a/src/Microsoft.TestPlatform.Utilities/ClientUtilities.cs b/src/Microsoft.TestPlatform.Utilities/ClientUtilities.cs index 91b4879861..473f8cc9b5 100644 --- a/src/Microsoft.TestPlatform.Utilities/ClientUtilities.cs +++ b/src/Microsoft.TestPlatform.Utilities/ClientUtilities.cs @@ -18,7 +18,7 @@ public static class ClientUtilities private const string RunsettingsDirectory = "RunSettingsDirectory"; /// - /// Converts the relative paths in a runsetting file to absolue ones. + /// Converts the relative paths in a runsetting file to absolute ones. /// /// Xml Document containing Runsettings xml /// Path of the .runsettings xml file diff --git a/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs b/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs index 564618e37f..e039c85c2d 100644 --- a/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs +++ b/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs @@ -227,7 +227,7 @@ public static void UpdateTargetFramework(XmlDocument runSettingsDocument, string } /// - /// Validates the collectors in runsettings when an inlined testsettings is specified + /// Validates the collectors in runsettings when an in-lined testsettings is specified /// /// RunSettings used for the run /// True if an incompatible collector is found @@ -242,7 +242,7 @@ public static bool AreRunSettingsCollectorsInCompatibleWithTestSettings(string r // Explicitly blocking usage of data collectors through modes runsettings and testsettings except // for couple of scenarios where the IDE generates the collector settings in the runsettings file even when // it has an embedded testsettings file. Longterm runsettings will be the single run configuration source - // Inproc collectos are incompatible with testsettings + // In-proc collectors are incompatible with testsettings var inprocDataCollectionSettings = XmlRunSettingsUtilities.GetInProcDataCollectionRunSettings(runsettings); if (inprocDataCollectionSettings != null && inprocDataCollectionSettings.IsCollectionEnabled && inprocDataCollectionSettings.DataCollectorSettingsList != null) { @@ -487,7 +487,7 @@ public static bool IsTestSettingsEnabled(string runsettingsXml) } /// - /// Adds node under RunConfiguration setting. Noop if node is already present. + /// Adds node under RunConfiguration setting. No op if node is already present. /// private static void AddNodeIfNotPresent(XmlDocument xmlDocument, string nodePath, string nodeName, T nodeValue, bool overwrite = false) { @@ -695,7 +695,7 @@ public static IEnumerable FilterCompatibleSources(Architecture chosenPla } /// - /// Returns true if source settings are incomaptible with target settings. + /// Returns true if source settings are incompatible with target settings. /// private static bool IsSettingIncompatible(Architecture sourcePlatform, Architecture targetPlatform, diff --git a/src/Microsoft.TestPlatform.Utilities/ParallelRunSettingsUtilities.cs b/src/Microsoft.TestPlatform.Utilities/ParallelRunSettingsUtilities.cs index 80f4f7491c..a61706edf4 100644 --- a/src/Microsoft.TestPlatform.Utilities/ParallelRunSettingsUtilities.cs +++ b/src/Microsoft.TestPlatform.Utilities/ParallelRunSettingsUtilities.cs @@ -33,13 +33,13 @@ public static class ParallelRunSettingsUtilities "; /// - /// This will update the RunSetting with MaxCpuCount 0 if RunSetting doesnt configured with this setting. + /// This will update the RunSetting with MaxCpuCount 0 if RunSetting doesn't configured with this setting. /// /// RunSetting file. public static void UpdateRunSettingsWithParallelSettingIfNotConfigured(XPathNavigator navigator) { var node = navigator.SelectSingleNode(XpathOfMaxCpuCount); - // run settings given by user takes precendence over parallel switch + // run settings given by user takes precedence over parallel switch if (node == null) { var runConfigurationNavigator = navigator.SelectSingleNode(XpathOfRunConfiguration); diff --git a/src/Microsoft.TestPlatform.Utilities/XmlUtilities.cs b/src/Microsoft.TestPlatform.Utilities/XmlUtilities.cs index 6ca25312a2..9b97a0f5ef 100644 --- a/src/Microsoft.TestPlatform.Utilities/XmlUtilities.cs +++ b/src/Microsoft.TestPlatform.Utilities/XmlUtilities.cs @@ -58,7 +58,7 @@ internal static void AppendOrModifyChild( { var childNode = xmlDocument.SelectSingleNode(nodeXPath); - // Todo: There isn't an equivalent API to SecurityElement.Escape in Core yet. + // TODO: There isn't an equivalent API to SecurityElement.Escape in Core yet. // So trusting that the XML is always valid for now. #if NET451 var secureInnerXml = SecurityElement.Escape(innerXml); diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleProcessManager.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleProcessManager.cs index 44ce00911a..a89b5f2431 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleProcessManager.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleProcessManager.cs @@ -65,7 +65,7 @@ internal class VsTestConsoleProcessManager : IProcessManager /// /// Creates an instance of VsTestConsoleProcessManager class. /// - /// The fullpath to vstest.console + /// The full path to vstest.console public VsTestConsoleProcessManager(string vstestConsolePath) { this.FileHelper = new FileHelper(); diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleRequestSender.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleRequestSender.cs index 9067b03042..d45dd5f00e 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleRequestSender.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleRequestSender.cs @@ -338,7 +338,7 @@ public void CancelTestRun() { if (EqtTrace.IsInfoEnabled) { - EqtTrace.Info("VsTestConsoleRequestSender.CancelTestRun: Cancelling test run."); + EqtTrace.Info("VsTestConsoleRequestSender.CancelTestRun: Canceling test run."); } this.communicationManager.SendMessage(MessageType.CancelTestRun); } @@ -358,7 +358,7 @@ public void CancelDiscovery() { if (EqtTrace.IsInfoEnabled) { - EqtTrace.Info("VsTestConsoleRequestSender.CancelDiscovery: Cancelling test discovery."); + EqtTrace.Info("VsTestConsoleRequestSender.CancelDiscovery: Canceling test discovery."); } this.communicationManager.SendMessage(MessageType.CancelDiscovery); } @@ -442,7 +442,7 @@ private async Task HandShakeWithVsTestConsoleAsync() else if (message.MessageType == MessageType.ProtocolError) { // TODO : Payload for ProtocolError needs to finalized. - EqtTrace.Error("VsTestConsoleRequestSender.HandShakeWithVsTestConsoleAsync: Version Check failed. ProtolError was revceived from the runner"); + EqtTrace.Error("VsTestConsoleRequestSender.HandShakeWithVsTestConsoleAsync: Version Check failed. ProtolError was received from the runner"); } else { @@ -766,7 +766,7 @@ private void HandleCustomHostLaunch(ITestHostLauncher customHostLauncher, Messag } finally { - // Always unblock the Vstest.console thread which is indefintitely waiting on this ACK + // Always unblock the Vstest.console thread which is indefinitely waiting on this ACK this.communicationManager.SendMessage(MessageType.CustomTestHostLaunchCallback, ackPayload, this.protocolVersion); } } diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleWrapper.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleWrapper.cs index d22e5eb3a9..42f587d0f4 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleWrapper.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleWrapper.cs @@ -262,7 +262,7 @@ public void AbortTestRun() /// public void EndSession() { - EqtTrace.Info("VsTestConsoleWrapper.EndSession: Endinhg VsTestConsoleWrapper session"); + EqtTrace.Info("VsTestConsoleWrapper.EndSession: Ending VsTestConsoleWrapper session"); this.requestSender.EndSession(); this.requestSender.Close(); diff --git a/src/SettingsMigrator/Program.cs b/src/SettingsMigrator/Program.cs index 20dbca2a11..9a585e04dc 100644 --- a/src/SettingsMigrator/Program.cs +++ b/src/SettingsMigrator/Program.cs @@ -16,7 +16,7 @@ public static class Program /// /// Main entry point. Hands off execution to Migrator. /// - /// Arguments on the commandline + /// Arguments on the command line /// Exit code public static int Main(string[] args) { diff --git a/src/datacollector/Program.cs b/src/datacollector/Program.cs index 4551989e1f..3554b2c75d 100644 --- a/src/datacollector/Program.cs +++ b/src/datacollector/Program.cs @@ -25,7 +25,7 @@ public static void Main(string[] args) } catch (Exception ex) { - EqtTrace.Error("Program.Main: Error occured during initialization of Datacollector : {0}", ex); + EqtTrace.Error("Program.Main: Error occurred during initialization of Datacollector : {0}", ex); throw; } finally diff --git a/src/testhost.x86/AppDomainEngineInvoker.cs b/src/testhost.x86/AppDomainEngineInvoker.cs index 5638740760..7859e5961b 100644 --- a/src/testhost.x86/AppDomainEngineInvoker.cs +++ b/src/testhost.x86/AppDomainEngineInvoker.cs @@ -54,7 +54,7 @@ public void Invoke(IDictionary argsDictionary) { //if(appDomain != null) //{ - // Donot unload appdomain as there are lot is issues reported against appdomain unload + // Do not unload appdomain as there are lot is issues reported against appdomain unload // any ways the process is going to die off. // AppDomain.Unload(appDomain); //} @@ -259,7 +259,7 @@ private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs a } // Put it in the resolved assembly so that if below Assembly.Load call - // triggers another assembly resolution, then we dont end up in stack overflow + // triggers another assembly resolution, then we don't end up in stack overflow resolvedAssemblies[args.Name] = null; foreach (var path in resolverPaths) diff --git a/src/testhost.x86/DefaultEngineInvoker.cs b/src/testhost.x86/DefaultEngineInvoker.cs index 24f8c5be5d..e14e780854 100644 --- a/src/testhost.x86/DefaultEngineInvoker.cs +++ b/src/testhost.x86/DefaultEngineInvoker.cs @@ -256,8 +256,8 @@ private Task StartProcessingAsync(ITestRequestHandler requestHandler, ITestHostM // The reason to wait infinitely, was remote debugging scenarios of UWP app, // in such cases after the app gets launched, VS debugger takes control of it, & causes a lot of delay, which frequently causes timeout with vstest.console. // One fix would be just double this timeout, but there is no telling how much time it can actually take. - // Hence we are waiting here indefinelty, to avoid such guessed timeouts, & letting user kill the debugging if they feel it is taking too much time. - // In other cases if vstest.console's timeout exceeds it will definitelty such down the app. + // Hence we are waiting here indefinitely, to avoid such guessed timeouts, & letting user kill the debugging if they feel it is taking too much time. + // In other cases if vstest.console's timeout exceeds it will definitely such down the app. if (requestHandler.WaitForRequestSenderConnection(ClientListenTimeOut)) { EqtTrace.Info("DefaultEngineInvoker.StartProcessingAsync: Connected to vstest.console, Starting process requests."); diff --git a/src/testhost.x86/Program.cs b/src/testhost.x86/Program.cs index b77fbd52a2..bb1f302e95 100644 --- a/src/testhost.x86/Program.cs +++ b/src/testhost.x86/Program.cs @@ -37,7 +37,7 @@ public static void Main(string[] args) } catch (Exception ex) { - EqtTrace.Error("TestHost: Error occured during initialization of TestHost : {0}", ex); + EqtTrace.Error("TestHost: Error occurred during initialization of TestHost : {0}", ex); // Throw exception so that vstest.console get the exception message. throw; diff --git a/src/vstest.console/CommandLine/AssemblyMetadataProvider.cs b/src/vstest.console/CommandLine/AssemblyMetadataProvider.cs index 9222607d3d..8ed3b90b8f 100644 --- a/src/vstest.console/CommandLine/AssemblyMetadataProvider.cs +++ b/src/vstest.console/CommandLine/AssemblyMetadataProvider.cs @@ -65,7 +65,7 @@ public Architecture GetArchitecture(string assemblyPath) } catch (Exception ex) { - // AssemblyName will thorw Exception if assembly contains native code or no manifest. + // AssemblyName will throw Exception if assembly contains native code or no manifest. if (EqtTrace.IsVerboseEnabled) { @@ -111,7 +111,7 @@ private static FrameworkName GetFrameworkNameFromAssemblyMetadata(Stream assembl var fxEndIndex = result.IndexOf("\u0001", fxStartIndex, StringComparison.Ordinal); if (fxStartIndex > -1 && fxEndIndex > fxStartIndex) { - // Using -3 because custom attribute values seperated by unicode characters. + // Using -3 because custom attribute values separated by unicode characters. result = result.Substring(fxStartIndex, fxEndIndex - 3); frameworkName = new FrameworkName(result); break; @@ -192,7 +192,7 @@ public Architecture GetArchitectureForSource(string imagePath) fs.Position = peHeader; var signature = reader.ReadUInt32(); //peHeaderSignature - // 0x00004550 is the letters "PE" followed by two terminating zeroes. + // 0x00004550 is the letters "PE" followed by two terminating zeros. if (signature != 0x00004550) { validImage = false; @@ -200,7 +200,7 @@ public Architecture GetArchitectureForSource(string imagePath) if (validImage) { - //Read the image file header header. + //Read the image file header. machine = reader.ReadUInt16(); reader.ReadUInt16(); //NumberOfSections reader.ReadUInt32(); //TimeDateStamp diff --git a/src/vstest.console/CommandLine/CommandArgumentPair.cs b/src/vstest.console/CommandLine/CommandArgumentPair.cs index a8e09b5ef8..c75f4ac99b 100644 --- a/src/vstest.console/CommandLine/CommandArgumentPair.cs +++ b/src/vstest.console/CommandLine/CommandArgumentPair.cs @@ -87,12 +87,12 @@ private void Parse(string input) Contract.Ensures(!String.IsNullOrWhiteSpace(Command)); Contract.Ensures(Argument != null); - // Find the index of the seperator (":") + // Find the index of the separator (":") int index = input.IndexOf(CommandArgumentPair.Separator, StringComparison.OrdinalIgnoreCase); if (index == -1) { - // No seperator was found, so use the input as the command. + // No separator was found, so use the input as the command. this.Command = input; this.Argument = String.Empty; } diff --git a/src/vstest.console/CommandLine/CommandLineOptions.cs b/src/vstest.console/CommandLine/CommandLineOptions.cs index 0109de30c6..613e14db8c 100644 --- a/src/vstest.console/CommandLine/CommandLineOptions.cs +++ b/src/vstest.console/CommandLine/CommandLineOptions.cs @@ -106,7 +106,7 @@ protected CommandLineOptions() public bool InIsolation { get; set; } /// - /// Readonly collection of all available test sources + /// Read only collection of all available test sources /// public IEnumerable Sources { diff --git a/src/vstest.console/CommandLine/Executor.cs b/src/vstest.console/CommandLine/Executor.cs index e999e552ec..58466b139a 100644 --- a/src/vstest.console/CommandLine/Executor.cs +++ b/src/vstest.console/CommandLine/Executor.cs @@ -10,7 +10,7 @@ // Allow command processors to validate against other command processors which are present. // If throws during validation, output error and exit. // Process each command processor. -// If throws during validaton, output error and exit. +// If throws during validation, output error and exit. // If the default (RunTests) command processor has no test containers output an error and exit // If the default (RunTests) command processor has no tests to run output an error and exit @@ -85,13 +85,13 @@ internal Executor(IOutput output, ITestPlatformEventSource testPlatformEventSour /// Arguments provided to perform execution with. /// /// - /// Exit Codes - Zero (for sucessful command execution), One (for bad command) + /// Exit Codes - Zero (for successful command execution), One (for bad command) /// internal int Execute(params string[] args) { this.testPlatformEventSource.VsTestConsoleStart(); - // If User specifies --nologo via dotnet, donot print splat screen + // If User specifies --nologo via dotnet, do not print splat screen if (args != null && args.Length !=0 && args.Contains("--nologo")) { // Sanitizing this list, as I don't think we should write Argument processor for this. @@ -244,7 +244,7 @@ private int GetArgumentProcessors(string[] args, out List pr else { // Let it throw - User must see crash and report it with stack trace! - // No need for recoverability as user will start a new vstest.console anwyay + // No need for recoverability as user will start a new vstest.console anyway throw; } } @@ -350,7 +350,7 @@ private bool ExecuteArgumentProcessor(IArgumentProcessor processor, ref int exit else { // Let it throw - User must see crash and report it with stack trace! - // No need for recoverability as user will start a new vstest.console anwyay + // No need for recoverability as user will start a new vstest.console anyway throw; } } diff --git a/src/vstest.console/CommandLine/InferHelper.cs b/src/vstest.console/CommandLine/InferHelper.cs index 1168cec2fb..c35171b6ba 100644 --- a/src/vstest.console/CommandLine/InferHelper.cs +++ b/src/vstest.console/CommandLine/InferHelper.cs @@ -104,14 +104,14 @@ public Framework AutoDetectFramework(List sources, IDictionary - /// Raises test run warning occured before console logger starts listening warning events. + /// Raises test run warning occurred before console logger starts listening warning events. /// /// public static void RaiseTestRunWarning(string warningMessage) diff --git a/src/vstest.console/Internal/FilePatternParser.cs b/src/vstest.console/Internal/FilePatternParser.cs index 59a418420e..7c1fdb2eb5 100644 --- a/src/vstest.console/Internal/FilePatternParser.cs +++ b/src/vstest.console/Internal/FilePatternParser.cs @@ -51,7 +51,7 @@ public List GetMatchingFiles(string filePattern) filePattern = Path.Combine(this.fileHelper.GetCurrentDirectory(), filePattern); } - // If there is no wildcard simply add the file to the list of matching files. + // If there is no wild card simply add the file to the list of matching files. if (filePattern.IndexOfAny(wildCardCharacters) == -1) { EqtTrace.Info($"FilePatternParser: The given file {filePattern} is a full path."); @@ -68,7 +68,7 @@ public List GetMatchingFiles(string filePattern) return matchingFiles; } - // Split the given wildcard into search directory and pattern to be searched. + // Split the given wild card into search directory and pattern to be searched. var splitPattern = SplitFilePatternOnWildCard(filePattern); EqtTrace.Info($"FilePatternParser: Matching file pattern '{splitPattern.Item2}' within directory '{splitPattern.Item1}'"); @@ -91,7 +91,7 @@ public List GetMatchingFiles(string filePattern) /// private Tuple SplitFilePatternOnWildCard(string filePattern) { - // Split the pattern based on first wildcard character found. + // Split the pattern based on first wild card character found. var splitOnWildCardIndex = filePattern.IndexOfAny(wildCardCharacters); var directorySeparatorIndex = filePattern.Substring(0, splitOnWildCardIndex).LastIndexOf(Path.DirectorySeparatorChar); diff --git a/src/vstest.console/Processors/CollectArgumentProcessor.cs b/src/vstest.console/Processors/CollectArgumentProcessor.cs index f603e2314c..9cc904b443 100644 --- a/src/vstest.console/Processors/CollectArgumentProcessor.cs +++ b/src/vstest.console/Processors/CollectArgumentProcessor.cs @@ -105,7 +105,7 @@ internal CollectArgumentExecutor(IRunSettingsProvider runSettingsManager, IFileH /// public void Initialize(string argument) { - // 1. Disable all other data collectors. Enable only those data collectors that are explicitely specified by user. + // 1. Disable all other data collectors. Enable only those data collectors that are explicitly specified by user. // 2. Check if Code Coverage Data Collector is specified in runsettings, if not add it and also set enable to true. // if argument is null or doesn't contain any element, don't do anything. @@ -126,7 +126,7 @@ public void Initialize(string argument) } /// - /// Returns coverlet codebase searching coverlet.collector.dll assembly inside adaptersPaths + /// Returns coverlet code base searching coverlet.collector.dll assembly inside adaptersPaths /// private static string GetCoverletCodeBasePath(IRunSettingsProvider runSettingProvider, IFileHelper fileHelper) { @@ -167,7 +167,7 @@ internal static void EnableDataCollectorUsingFriendlyName(string argument, DataC } /// - /// Enables coverlet inproc datacollector + /// Enables coverlet in-proc datacollector /// internal static void EnableCoverletInProcDataCollector(string argument, DataCollectionRunSettings dataCollectionRunSettings, IRunSettingsProvider runSettingProvider, IFileHelper fileHelper) { @@ -175,7 +175,7 @@ internal static void EnableCoverletInProcDataCollector(string argument, DataColl if (!DoesDataCollectorSettingsExist(argument, dataCollectionRunSettings, out dataCollectorSettings)) { - // Create a new setting with deafult values + // Create a new setting with default values dataCollectorSettings = new DataCollectorSettings(); dataCollectorSettings.FriendlyName = argument; dataCollectorSettings.AssemblyQualifiedName = CoverletConstants.CoverletDataCollectorAssemblyQualifiedName; @@ -185,7 +185,7 @@ internal static void EnableCoverletInProcDataCollector(string argument, DataColl } else { - // Set Assembly qualified name and codebase if not already set + // Set Assembly qualified name and code base if not already set dataCollectorSettings.AssemblyQualifiedName = dataCollectorSettings.AssemblyQualifiedName ?? CoverletConstants.CoverletDataCollectorAssemblyQualifiedName; dataCollectorSettings.CodeBase = dataCollectorSettings.CodeBase ?? CoverletConstants.CoverletDataCollectorCodebase; dataCollectorSettings.IsEnabled = true; @@ -248,17 +248,17 @@ internal static void AddDataCollectorFriendlyName(string friendlyName) internal static class CoverletConstants { /// - /// Coverlet inproc data collector friendlyname + /// Coverlet in-proc data collector friendly name /// public const string CoverletDataCollectorFriendlyName = "XPlat Code Coverage"; /// - /// Coverlet inproc data collector assembly qualified name + /// Coverlet in-proc data collector assembly qualified name /// public const string CoverletDataCollectorAssemblyQualifiedName = "Coverlet.Collector.DataCollection.CoverletInProcDataCollector, coverlet.collector, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"; /// - /// Coverlet inproc data collector codebase + /// Coverlet in-proc data collector code base /// public const string CoverletDataCollectorCodebase = "coverlet.collector.dll"; } diff --git a/src/vstest.console/Processors/EnableCodeCoverageArgumentProcessor.cs b/src/vstest.console/Processors/EnableCodeCoverageArgumentProcessor.cs index f0ca15baa0..fc9c490749 100644 --- a/src/vstest.console/Processors/EnableCodeCoverageArgumentProcessor.cs +++ b/src/vstest.console/Processors/EnableCodeCoverageArgumentProcessor.cs @@ -270,7 +270,7 @@ private void UpdateWithCodeCoverageSettingsIfNotConfigured() } } - // If any nodes are missing to add code coverage deafult settings, add the missing xml nodes. + // If any nodes are missing to add code coverage default settings, add the missing xml nodes. XPathNavigator dataCollectorsNavigator; if (existingPath.Equals(xpaths[2]) == false) { diff --git a/src/vstest.console/Processors/HelpArgumentProcessor.cs b/src/vstest.console/Processors/HelpArgumentProcessor.cs index fe0f122984..a6d0171e02 100644 --- a/src/vstest.console/Processors/HelpArgumentProcessor.cs +++ b/src/vstest.console/Processors/HelpArgumentProcessor.cs @@ -124,7 +124,7 @@ public void Initialize(string argument) public ArgumentProcessorResult Execute() { - // Output the stock ouput text + // Output the stock output text OutputSection(CommandLineResources.HelpUsageText); OutputSection(CommandLineResources.HelpDescriptionText); OutputSection(CommandLineResources.HelpArgumentsText); @@ -164,10 +164,10 @@ public ArgumentProcessorResult Execute() #region Private Methods /// - /// Lookup the help description for the argument procesor. + /// Lookup the help description for the argument processor. /// /// The argument processor for which to discover any help content - /// The formatted string containing the help description if foundl null otherwise + /// The formatted string containing the help description if found null otherwise private string LookupHelpDescription(IArgumentProcessor argumentProcessor) { string result = null; diff --git a/src/vstest.console/Processors/InIsolationArgumentProcessor.cs b/src/vstest.console/Processors/InIsolationArgumentProcessor.cs index c56a414186..ab886429cb 100644 --- a/src/vstest.console/Processors/InIsolationArgumentProcessor.cs +++ b/src/vstest.console/Processors/InIsolationArgumentProcessor.cs @@ -93,7 +93,7 @@ internal class InIsolationArgumentExecutor : IArgumentExecutor /// /// Constructor /// - /// Commandline options + /// Command line options /// the runsettings manager public InIsolationArgumentExecutor(CommandLineOptions options, IRunSettingsProvider runSettingsManager) { diff --git a/src/vstest.console/Processors/Interfaces/IArgumentProcessorCapabilities.cs b/src/vstest.console/Processors/Interfaces/IArgumentProcessorCapabilities.cs index aa648cecb3..69a61f27f9 100644 --- a/src/vstest.console/Processors/Interfaces/IArgumentProcessorCapabilities.cs +++ b/src/vstest.console/Processors/Interfaces/IArgumentProcessorCapabilities.cs @@ -19,7 +19,7 @@ internal interface IArgumentProcessorCapabilities string CommandName { get; } /// - /// Indicates if multiple of of the command are allowed. + /// Indicates if multiple of the command are allowed. /// bool AllowMultiple { get; } diff --git a/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs b/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs index af093c54a9..19647d5e55 100644 --- a/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs +++ b/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs @@ -269,7 +269,7 @@ private void discoveryRequest_OnDiscoveredTests(Object sender, DiscoveredTestsEv throw new TestPlatformException("DiscoveredTestsEventArgs cannot be null."); } - // Initialising the test case filter here because the filter value is read late. + // Initializing the test case filter here because the filter value is read late. this.testCasefilter.Initialize(this.options.TestCaseFilterValue); var discoveredTests = args.DiscoveredTestCases.ToList(); var filteredTests = this.testCasefilter.FilterTests(discoveredTests).ToList(); @@ -374,7 +374,7 @@ private static List GetFilteredTestCases(IEnumerable testCas } /// - /// fetch the testproperties on this test method as traits and populate a trait dictionary + /// fetch the test properties on this test method as traits and populate a trait dictionary /// private static Dictionary> GetTestPropertiesInTraitDictionary(TestCase testCase) { @@ -443,7 +443,7 @@ private static Dictionary> GetTraitsInTraitDictionary(Dicti } } - //This is hack for NUnit,Xunit to understand test category -> This method is called only for NUnit/Xunit + //This is hack for NUnit, XUnit to understand test category -> This method is called only for NUnit/XUnit if (!traitDictionary.ContainsKey(TestCategory) && traitDictionary.ContainsKey(Category)) { traitDictionary.TryGetValue(Category, out var categoryValue); diff --git a/src/vstest.console/Processors/RunSpecificTestsArgumentProcessor.cs b/src/vstest.console/Processors/RunSpecificTestsArgumentProcessor.cs index a0aa82b313..0f5cf3f151 100644 --- a/src/vstest.console/Processors/RunSpecificTestsArgumentProcessor.cs +++ b/src/vstest.console/Processors/RunSpecificTestsArgumentProcessor.cs @@ -118,7 +118,7 @@ internal class RunSpecificTestsArgumentExecutor : IArgumentExecutor private long discoveredTestCount = 0; /// - /// Collection of test cases that match atleast one of the given search strings + /// Collection of test cases that match at least one of the given search strings /// private Collection selectedTestCases = new Collection(); @@ -375,7 +375,7 @@ public void UnregisterTestRunEvents(ITestRunRequest testRunRequest) /// RunCompletion args private void TestRunRequest_OnRunCompletion(object sender, TestRunCompleteEventArgs e) { - // If run is not aborted/cancelled then check the count of executed tests. + // If run is not aborted/canceled then check the count of executed tests. // we need to check if there are any tests executed - to try show some help info to user to check for installed vsix extensions if (!e.IsAborted && !e.IsCanceled) { diff --git a/src/vstest.console/Processors/RunTestsArgumentProcessor.cs b/src/vstest.console/Processors/RunTestsArgumentProcessor.cs index 568f298b35..cffaa8f44e 100644 --- a/src/vstest.console/Processors/RunTestsArgumentProcessor.cs +++ b/src/vstest.console/Processors/RunTestsArgumentProcessor.cs @@ -237,7 +237,7 @@ public void UnregisterTestRunEvents(ITestRunRequest testRunRequest) /// RunCompletion args private void TestRunRequest_OnRunCompletion(object sender, TestRunCompleteEventArgs e) { - // If run is not aborted/cancelled then check the count of executed tests. + // If run is not aborted/canceled then check the count of executed tests. // we need to check if there are any tests executed - to try show some help info to user to check for installed vsix extensions if (!e.IsAborted && !e.IsCanceled) { diff --git a/src/vstest.console/Processors/Utilities/ArgumentProcessorUtilities.cs b/src/vstest.console/Processors/Utilities/ArgumentProcessorUtilities.cs index 83b7c0328b..b8ea8c0f9a 100644 --- a/src/vstest.console/Processors/Utilities/ArgumentProcessorUtilities.cs +++ b/src/vstest.console/Processors/Utilities/ArgumentProcessorUtilities.cs @@ -15,7 +15,7 @@ internal class ArgumentProcessorUtilities public static readonly char[] EqualNameValueSeparator = { '=' }; /// - /// Get argument list from raw argument usign argument separator. + /// Get argument list from raw argument using argument separator. /// /// Raw argument. /// Argument separator. diff --git a/src/vstest.console/Publisher/MetricsPublisherFactory.cs b/src/vstest.console/Publisher/MetricsPublisherFactory.cs index 9f7ae60f12..96d45ddef1 100644 --- a/src/vstest.console/Publisher/MetricsPublisherFactory.cs +++ b/src/vstest.console/Publisher/MetricsPublisherFactory.cs @@ -7,7 +7,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine.Publisher using System.Threading.Tasks; /// - /// Rerturns the Instance of on basis of given parameters. + /// Returns the Instance of on basis of given parameters. /// public class MetricsPublisherFactory { diff --git a/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs b/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs index 65e00437f6..edf84837bf 100644 --- a/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs +++ b/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs @@ -484,7 +484,7 @@ private bool UpdatePlatform(XmlDocument document, XPathNavigator navigator, List // Get platform from runsettings bool updatePlatform = IsAutoPlatformDetectRequired(navigator, out chosenPlatform); - // Update platform if required. For commandline scenario update happens in ArgumentProcessor. + // Update platform if required. For command line scenario update happens in ArgumentProcessor. if (updatePlatform) { InferRunSettingsHelper.UpdateTargetPlatform(document, inferedPlatform.ToString(), overwrite: true); @@ -502,7 +502,7 @@ private bool UpdateFramework(XmlDocument document, XPathNavigator navigator, Lis // Get framework from runsettings. bool updateFramework = IsAutoFrameworkDetectRequired(navigator, out chosenFramework); - // Update framework if required. For commandline scenario update happens in ArgumentProcessor. + // Update framework if required. For command line scenario update happens in ArgumentProcessor. if (updateFramework) { InferRunSettingsHelper.UpdateTargetFramework(document, inferedFramework?.ToString(), overwrite: true); @@ -571,7 +571,7 @@ private bool UpdateConsoleLoggerIfExists(XmlDocument document, LoggerRunSettings private void RunTests(IRequestData requestData, TestRunCriteria testRunCriteria, ITestRunEventsRegistrar testRunEventsRegistrar, TestPlatformOptions options) { // Make sure to run the run request inside a lock as the below section is not thread-safe - // TranslationLayer can process faster as it directly gets the raw unserialized messages whereas + // TranslationLayer can process faster as it directly gets the raw un-serialized messages whereas // below logic needs to deserialize and do some cleanup // While this section is cleaning up, TranslationLayer can trigger run causing multiple threads to run the below section at the same time lock (this.syncObject) @@ -668,10 +668,10 @@ private void CollectMetrics(IRequestData requestData, RunConfiguration runConfig // Collecting Target Platform. requestData.MetricsCollection.Add(TelemetryDataConstants.TargetPlatform, runConfiguration.TargetPlatform.ToString()); - // Collecting Max Cpu count. + // Collecting Max CPU count. requestData.MetricsCollection.Add(TelemetryDataConstants.MaxCPUcount, runConfiguration.MaxCpuCount); - // Collecting Target Device. Here, it will be updated run settings so, target device will be under runconfiguration only. + // Collecting Target Device. Here, it will be updated run settings so, target device will be under run configuration only. var targetDevice = runConfiguration.TargetDevice; if (string.IsNullOrEmpty(targetDevice)) { diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/CodeCoverageTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/CodeCoverageTests.cs index d57fa665a6..38f8c73a85 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/CodeCoverageTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/CodeCoverageTests.cs @@ -69,7 +69,7 @@ private void CollectCodeCoverage(RunnerInfo runnerInfo, string targetPlatform, b Console.WriteLine($@"Coverage file: {actualCoverageFile} Results directory: {resultsDirectory} trxfile: {trxFilePath}"); Assert.IsTrue(File.Exists(actualCoverageFile), "Coverage file not found: {0}", actualCoverageFile); - // Microsoft.VisualStudio.Coverage.Analysis assembly not avaialble for .NET Core. + // Microsoft.VisualStudio.Coverage.Analysis assembly not available for .NET Core. #if NET451 this.ValidateCoverageData(actualCoverageFile); #endif @@ -160,7 +160,7 @@ private static string GetCoverageFileNameFromTrx(string trxFilePath, string resu "None or more than one Deployment tags found in trx file:{0}", trxFilePath); var deploymentDir = deploymentElements[0].Attributes.GetNamedItem("runDeploymentRoot")?.Value; Assert.IsTrue(string.IsNullOrEmpty(deploymentDir) == false, - "runDeploymentRoot attatribute not found in trx file:{0}", trxFilePath); + "runDeploymentRoot attribute not found in trx file:{0}", trxFilePath); var collectors = doc.GetElementsByTagName("Collector"); string fileName = string.Empty; @@ -183,7 +183,7 @@ private static string GetCoverageFileNameFromTrx(string trxFilePath, string resu private bool SkipIfRuningInCI(string message) { // Setting Console.ForegroundColor to newColor which will be used to determine whether - // test command output is redirecting to file or writting to console. + // test command output is redirecting to file or writing to console. // If command output is redirecting to file, then Console.ForegroundColor can't be modified. // So that tests which assert Console.ForegroundColor should not run. var previousColor = Console.ForegroundColor; diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/RunsettingsTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/RunsettingsTests.cs index 8066cd512e..a6aa7b0973 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/RunsettingsTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/RunsettingsTests.cs @@ -96,7 +96,7 @@ public void CLIRunsettingsShouldWinBetweenCLISwitchesAndCLIRunsettings(RunnerInf } /// - /// Command line switches should have high precedence if runsetting file and commandline switch specified + /// Command line switches should have high precedence if runsetting file and command line switch specified /// /// /// @@ -481,7 +481,7 @@ public void EnvironmentVariablesSettingsShouldSetEnvironmentVariables(RunnerInfo #region RunSettings defined in project file /// /// RunSettingsFilePath can be specified in .csproj and should be honored by `dotnet test`, this test - /// checks that the settings were honored by translating an inconlusive test to failed "result", instead of the default "skipped". + /// checks that the settings were honored by translating an inconclusive test to failed "result", instead of the default "skipped". /// This test depends on Microsoft.TestPlatform.Build\Microsoft.TestPlatform.targets being previously copied into the /// artifacts/testArtifacts/dotnet folder. This will allow the local copy of dotnet to pickup the VSTest msbuild task. /// @@ -498,7 +498,7 @@ public void RunSettingsAreLoadedFromProject(RunnerInfo runnerInfo) this.InvokeDotnetTest(projectPath); this.ValidateSummaryStatus(0, 1, 0); - // make sure that we can revert the project settings back by providing a config from commandline + // make sure that we can revert the project settings back by providing a config from command line // keeping this in the same test, because it is easier to see that we are reverting settings that // are honored by dotnet test, instead of just using the default, which would produce the same // result diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/TelemetryTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/TelemetryTests.cs index e06eda7c39..8cf73614f6 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/TelemetryTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/TelemetryTests.cs @@ -41,7 +41,7 @@ public void TestCleanup() // Set Current Opt in Status Environment.SetEnvironmentVariable(TELEMETRY_OPTEDIN, CurrentOptInStatus); - // Unset the environment varaible + // Unset the environment variable Environment.SetEnvironmentVariable(LOG_TELEMETRY, "0"); if (Directory.Exists(this.resultPath)) diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTests.cs index ad155994c5..313cf702cb 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTests.cs @@ -150,8 +150,8 @@ public void RunTestsShouldThrowOnStackOverflowException(RunnerInfo runnerInfo) // Assert - // Not happy with this check, but have seen this behaviour on some machines. - // What this essentially means, that atleast run was aborted. + // Not happy with this check, but have seen this behavior on some machines. + // What this essentially means, that at least run was aborted. if (runnerInfo.RunnerFramework.StartsWith("netcoreapp")) { Assert.IsTrue(errorMessage.StartsWith(this.runEventHandler.LogMessage)); diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs index 4c3f9e7555..d01cd00e8b 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs @@ -21,7 +21,7 @@ namespace Microsoft.TestPlatform.AcceptanceTests.TranslationLayerTests public class RunTestsWithDifferentConfigurationTests : AcceptanceTestBase { private const string Netcoreapp = "netcoreapp"; - private const string Message = "VsTestConsoleWrapper donot support .Net Core Runner"; + private const string Message = "VsTestConsoleWrapper does not support .Net Core Runner"; private IVsTestConsoleWrapper vstestConsoleWrapper; private RunEventHandler runEventHandler; diff --git a/test/Microsoft.TestPlatform.Client.UnitTests/Execution/TestRunRequestTests.cs b/test/Microsoft.TestPlatform.Client.UnitTests/Execution/TestRunRequestTests.cs index 746cb9b99c..509a66b38a 100644 --- a/test/Microsoft.TestPlatform.Client.UnitTests/Execution/TestRunRequestTests.cs +++ b/test/Microsoft.TestPlatform.Client.UnitTests/Execution/TestRunRequestTests.cs @@ -283,7 +283,7 @@ public void HandleRawMessageShouldCallOnRawMessageReceived() string rawMessage = "HelloWorld"; string messageReceived = null; - // Call should NOT fail even if onrawmessagereceived is not registered. + // Call should NOT fail even if on raw message received is not registered. testRunRequest.HandleRawMessage(rawMessage); EventHandler handler = (sender, e) => { messageReceived = e; }; diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/TestPluginCacheTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/TestPluginCacheTests.cs index ca12c911d9..d30b1ec948 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/TestPluginCacheTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/TestPluginCacheTests.cs @@ -331,7 +331,7 @@ public void GetTestExtensionsShouldGetTestExtensionsFromCache() [TestMethod] public void GetTestExtensionsShouldShouldThrowIfDiscovererThrows() { - //todo : make ITestDiscoverer interface and then mock it in order to make this test case pass. + //TODO : make ITestDiscoverer interface and then mock it in order to make this test case pass. var extensionAssembly = typeof(TestPluginCacheTests).GetTypeInfo().Assembly.Location; Assert.ThrowsException(() => this.testablePluginCache.GetTestExtensions(extensionAssembly)); diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/TestPluginDiscovererTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/TestPluginDiscovererTests.cs index 6f860632f5..4b930a546d 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/TestPluginDiscovererTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/TestPluginDiscovererTests.cs @@ -144,7 +144,7 @@ public void GetTestExtensionsInformationShouldNotAbortOnFaultyExtensions() Assert.That.DoesNotThrow(() =>this.testPluginDiscoverer.GetTestExtensionsInformation(pathToExtensions)); } - #region implementations + #region Implementations #region Discoverers diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/Filtering/FastFilterTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/Filtering/FastFilterTests.cs index f5e1f7b382..ea68cb92a6 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/Filtering/FastFilterTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/Filtering/FastFilterTests.cs @@ -327,7 +327,7 @@ public void FastFilterShouldThrowExceptionForUnsupportedOperatorOperationCombina catch (Exception ex) { Assert.IsTrue(ex is ArgumentException); - Assert.AreEqual("An error occured while creating Fast filter.", ex.Message); + Assert.AreEqual("An error occurred while creating Fast filter.", ex.Message); } } diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/Hosting/TestHostProviderManagerTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/Hosting/TestHostProviderManagerTests.cs index 692130649f..e1ba55ed39 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/Hosting/TestHostProviderManagerTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/Hosting/TestHostProviderManagerTests.cs @@ -148,7 +148,7 @@ public void TestHostProviderManagerShouldReturnNullIfTargetFrameworkIsPortable() Assert.IsNull(manager.GetTestHostManagerByRunConfiguration(runSettingsXml)); } - #region implementations + #region Implementations [ExtensionUri("executor://DesktopTestHost")] [FriendlyName("DesktopTestHost")] diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/Logging/InternalTestLoggerEventsTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/Logging/InternalTestLoggerEventsTests.cs index db50c38874..c62a014c24 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/Logging/InternalTestLoggerEventsTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/Logging/InternalTestLoggerEventsTests.cs @@ -37,7 +37,7 @@ public void Dispose() [TestMethod] public void RaiseTestRunMessageShouldNotThrowExceptionIfNoEventHandlersAreRegistered() { - // Send the test mesage event. + // Send the test message event. loggerEvents.RaiseTestRunMessage(new TestRunMessageEventArgs(TestMessageLevel.Informational,"This is a string.")); } @@ -58,7 +58,7 @@ public void RaiseTestRunMessageShouldInvokeRegisteredEventHandlerIfTestRunMessag }; loggerEvents.EnableEvents(); - // Send the test mesage event. + // Send the test message event. loggerEvents.RaiseTestRunMessage(new TestRunMessageEventArgs(TestMessageLevel.Informational, message)); var waitSuccess = waitHandle.WaitOne(500); diff --git a/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Output/OutputExtensionsTests.cs b/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Output/OutputExtensionsTests.cs index 9f584af427..3e73efdfcb 100644 --- a/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Output/OutputExtensionsTests.cs +++ b/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Output/OutputExtensionsTests.cs @@ -19,7 +19,7 @@ public class OutputExtensionsTests public OutputExtensionsTests() { // Setting Console.ForegroundColor to newColor which will be used to determine whether - // test command output is redirecting to file or writting to console. + // test command output is redirecting to file or writing to console. // If command output is redirecting to file, then Console.ForegroundColor can't be modified. // So that tests which assert Console.ForegroundColor should not run. this.previousColor = Console.ForegroundColor; diff --git a/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Utilities/JobQueueTests.cs b/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Utilities/JobQueueTests.cs index 389ec5b9dd..af62dd0475 100644 --- a/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Utilities/JobQueueTests.cs +++ b/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Utilities/JobQueueTests.cs @@ -262,7 +262,7 @@ public void TestBlockAtEnqueueDueToLength() queue.QueueJob("job10", 0); queue.QueueJob("job11", 0); - // By this point surely the queue would have blocked atleast once, hence setting queue.enteredBlockingMethod true. + // By this point surely the queue would have blocked at least once, hence setting queue.enteredBlockingMethod true. Assert.IsTrue(queue.IsEnqueueBlocked, "Did not enter the over-ridden blocking method"); @@ -319,7 +319,7 @@ public void TestBlockAtEnqueueDueToSize() queue.QueueJob("job10", 10); queue.QueueJob("job11", 10); - // By this point surely the queue would have blocked atleast once, hence setting queue.enteredBlockingMethod true. + // By this point surely the queue would have blocked at least once, hence setting queue.enteredBlockingMethod true. Assert.IsTrue(queue.IsEnqueueBlocked, "Did not enter the over-ridden blocking method"); // We wait till all jobs are finished, so that for the next iteration the queue is in a deterministic state. @@ -409,7 +409,7 @@ public void TestLargeTestResultCanBeLoadedWithBlockingEnabled() // we check whether or not the queue size has exceeded the limit before actually queuing. queue.QueueJob("job1", 8); - // if queue.EnteredBlockingMethod is true, the enquing entered the over-ridden blocking method. This was not + // if queue.EnteredBlockingMethod is true, the enqueuing entered the overridden blocking method. This was not // intended. Assert.IsFalse(queue.EnteredBlockingMethod, "Entered the over-ridden blocking method."); jobProcessed.WaitOne(); diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/InProcessProxyDiscoveryManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/InProcessProxyDiscoveryManagerTests.cs index 451af19c94..d0c03775ab 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/InProcessProxyDiscoveryManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/InProcessProxyDiscoveryManagerTests.cs @@ -159,7 +159,7 @@ public void DiscoverTestRunShouldUpdateTestSourcesIfSourceDiffersFromTestHostMan Assert.IsTrue(manualResetEvent.WaitOne(5000), "IDiscoveryManager.DiscoverTests should get called"); - // AdapterSourceMap should contail updated testSources. + // AdapterSourceMap should contain updated testSources. Assert.AreEqual(actualSources.FirstOrDefault(), discoveryCriteria.AdapterSourceMap.FirstOrDefault().Value.FirstOrDefault()); Assert.AreEqual(inputSource.FirstOrDefault(), discoveryCriteria.Package); } diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelOperationManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelOperationManagerTests.cs index 5363a9dc0c..da218fd1f3 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelOperationManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelOperationManagerTests.cs @@ -100,7 +100,7 @@ public void DoActionOnConcurrentObjectsShouldCallAllObjects() [TestMethod] public void AddManagerShouldAddAManagerWithHandlerInConcurrentManagerList() { - // At the begining it should be equal to parallel level + // At the beginning it should be equal to parallel level Assert.AreEqual(2, this.proxyParallelManager.GetConcurrentManagersCount()); this.proxyParallelManager.AddManager(new SampleConcurrentClass(true), new SampleHandlerClass()); diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyDiscoveryManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyDiscoveryManagerTests.cs index 174ecec184..bcaee18ad0 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyDiscoveryManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyDiscoveryManagerTests.cs @@ -247,7 +247,7 @@ private void AssertMissingAndDuplicateSources(List processedSources) { if (matchFound) { - Assert.Fail("Concurrreny issue detected: Source['{0}'] got processed twice", processedSrc); + Assert.Fail("Concurrency issue detected: Source['{0}'] got processed twice", processedSrc); } matchFound = true; diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelRunDataAggregatorTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelRunDataAggregatorTests.cs index b560411ae4..c723116270 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelRunDataAggregatorTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelRunDataAggregatorTests.cs @@ -158,7 +158,7 @@ public void AggregateShouldAggregateExceptionsCorrectly() var aggregatedException = aggregator.GetAggregatedException() as AggregateException; Assert.IsNotNull(aggregatedException, "Aggregated exception must NOT be null"); Assert.IsNotNull(aggregatedException.InnerExceptions, "Inner exception list must NOT be null"); - Assert.AreEqual(aggregatedException.InnerExceptions.Count, 1, "Inner exception lsit must have one element"); + Assert.AreEqual(aggregatedException.InnerExceptions.Count, 1, "Inner exception list must have one element"); Assert.AreEqual(aggregatedException.InnerExceptions[0], exception1, "Inner exception must be the one set."); var exception2 = new NotSupportedException(); @@ -168,7 +168,7 @@ public void AggregateShouldAggregateExceptionsCorrectly() aggregatedException = aggregator.GetAggregatedException() as AggregateException; Assert.IsNotNull(aggregatedException, "Aggregated exception must NOT be null"); Assert.IsNotNull(aggregatedException.InnerExceptions, "Inner exception list must NOT be null"); - Assert.AreEqual(aggregatedException.InnerExceptions.Count, 2, "Inner exception lsit must have one element"); + Assert.AreEqual(aggregatedException.InnerExceptions.Count, 2, "Inner exception list must have one element"); Assert.AreEqual(aggregatedException.InnerExceptions[1], exception2, "Inner exception must be the one set."); } diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyExecutionManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyExecutionManagerTests.cs index 4b25cbf6e4..43f18f1145 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyExecutionManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyExecutionManagerTests.cs @@ -426,7 +426,7 @@ public void StartTestRunForCancelRequestShouldHandleLogMessageWithProperErrorMes this.testExecutionManager.StartTestRun(this.mockTestRunCriteria.Object, mockTestRunEventsHandler.Object); - mockTestRunEventsHandler.Verify(s => s.HandleLogMessage(TestMessageLevel.Error, "Cancelling the operation as requested.")); + mockTestRunEventsHandler.Verify(s => s.HandleLogMessage(TestMessageLevel.Error, "Canceling the operation as requested.")); } [TestMethod] diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyExecutionManagerWithDataCollectionTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyExecutionManagerWithDataCollectionTests.cs index 6261248b8a..abfde51160 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyExecutionManagerWithDataCollectionTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyExecutionManagerWithDataCollectionTests.cs @@ -191,7 +191,7 @@ public void LaunchProcessWithDebuggerAttachedShouldUpdateEnvironmentVariables() proxyExecutionManager.LaunchProcessWithDebuggerAttached(testProcessStartInfo); // Verify. - Assert.IsTrue(launchedStartInfo != null, "Failed to get the startinfo"); + Assert.IsTrue(launchedStartInfo != null, "Failed to get the start info"); foreach (var envVaribale in testProcessStartInfo.EnvironmentVariables) { Assert.AreEqual(envVaribale.Value, launchedStartInfo.EnvironmentVariables[envVaribale.Key], $"Expected environment variable {envVaribale.Key} : {envVaribale.Value} not found"); diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs index 145a5b928e..71b651429b 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs @@ -267,7 +267,7 @@ public void SetupChannelShouldThrowTestPlatformExceptionIfRequestCancelled() cancellationTokenSource.Cancel(); var message = Assert.ThrowsException(() => operationManager.SetupChannel(Enumerable.Empty(), this.defaultRunSettings)).Message; - StringAssert.Equals("Cancelling the operation as requested.", message); + StringAssert.Equals("Canceling the operation as requested.", message); } [TestMethod] @@ -282,7 +282,7 @@ public void SetupChannelShouldThrowTestPlatformExceptionIfRequestCancelledDuring var operationManager = new TestableProxyOperationManager(this.mockRequestData.Object, this.mockRequestSender.Object, this.mockTestHostManager.Object, cancellationTokenSource); var message = Assert.ThrowsException(() => operationManager.SetupChannel(Enumerable.Empty(), this.defaultRunSettings)).Message; - StringAssert.Equals("Cancelling the operation as requested.", message); + StringAssert.Equals("Canceling the operation as requested.", message); } [TestMethod] @@ -296,7 +296,7 @@ public void SetupChannelShouldThrowTestPlatformExceptionIfRequestCancelledPostHo var operationManager = new TestableProxyOperationManager(this.mockRequestData.Object, this.mockRequestSender.Object, this.mockTestHostManager.Object, cancellationTokenSource); var message = Assert.ThrowsException(() => operationManager.SetupChannel(Enumerable.Empty(), this.defaultRunSettings)).Message; - StringAssert.Equals("Cancelling the operation as requested.", message); + StringAssert.Equals("Canceling the operation as requested.", message); } [TestMethod] diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscovererEnumeratorTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscovererEnumeratorTests.cs index cb56326c87..414b59ba1a 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscovererEnumeratorTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscovererEnumeratorTests.cs @@ -416,7 +416,7 @@ public void LoadTestsShouldNotCallIntoDiscoverersWhenCancelled() // Validate Assert.IsFalse(ManagedDllTestDiscoverer.IsManagedDiscoverTestCalled); Assert.IsFalse(JsonTestDiscoverer.IsDiscoverTestCalled); - this.messageLoggerMock.Verify(logger => logger.SendMessage(TestMessageLevel.Warning, "Discovery of tests cancelled."), Times.Once); + this.messageLoggerMock.Verify(logger => logger.SendMessage(TestMessageLevel.Warning, "Discovery of tests canceled."), Times.Once); } [TestMethod] @@ -588,7 +588,7 @@ private void InvokeLoadTestWithMockSetup() this.discovererEnumerator.LoadTests(extensionSourceMap, this.runSettingsMock.Object, null, this.messageLoggerMock.Object); } - #region implementation + #region Implementation /// /// Placing this before others so that at runtime this would be the first to be discovered as a discoverer. diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithSourcesTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithSourcesTests.cs index fe552fa4ce..e0428af564 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithSourcesTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithSourcesTests.cs @@ -321,7 +321,7 @@ private void SetupForNoTestsAvailable(string testCaseFilter, out string sourcesS this.mockRequestData.Object); } - #region Testable Implemetations + #region Testable Implementations private class TestableRunTestsWithSources : RunTestsWithSources { diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithTestsTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithTestsTests.cs index ee729317c8..33f1402765 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithTestsTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithTestsTests.cs @@ -193,7 +193,7 @@ public void SendSessionEndShouldCallSessionEnd() mockTestCaseEventsHandler.Verify(x => x.SendSessionEnd()); } - #region Testable Implemetations + #region Testable Implementations private class TestableRunTestsWithTests : RunTestsWithTests { diff --git a/test/Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests/BlameCollectorTests.cs b/test/Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests/BlameCollectorTests.cs index e6f8edb181..fc622a0ee0 100644 --- a/test/Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests/BlameCollectorTests.cs +++ b/test/Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests/BlameCollectorTests.cs @@ -634,7 +634,7 @@ public void TriggerTestHostLaunchedHandlerShouldLogWarningForNonBooleanCollectAl } /// - /// The trigger test host launcehd handler should not break if start process dump throws TestPlatFormExceptions and log error message + /// The trigger test host launched handler should not break if start process dump throws TestPlatFormExceptions and log error message /// [TestMethod] public void TriggerTestHostLaunchedHandlerShouldCatchTestPlatFormExceptionsAndReportMessage() diff --git a/test/Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests/ProcessDumpUtilityTests.cs b/test/Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests/ProcessDumpUtilityTests.cs index c05a1316a9..835ca9d177 100644 --- a/test/Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests/ProcessDumpUtilityTests.cs +++ b/test/Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests/ProcessDumpUtilityTests.cs @@ -100,7 +100,7 @@ public void GetDumpFileWillReturnEmptyIfProcDumpDidntStart() } /// - /// GetDumpFile will wait for procdump process to exit before getting file + /// GetDumpFile will wait for proc dump process to exit before getting file /// [TestMethod] public void GetDumpFileWillWaitForProcessToExitAndGetDumpFile() @@ -130,7 +130,7 @@ public void GetDumpFileWillWaitForProcessToExitAndGetDumpFile() } /// - /// StartProcessDump should start procdump binary with correct arguments, while GetDumpFile returns full path + /// StartProcessDump should start proc dump binary with correct arguments, while GetDumpFile returns full path /// [TestMethod] public void StartProcessDumpWillStartProcDumpExeWithCorrectParamsAndGetDumpFileReturnsFullPath() @@ -163,7 +163,7 @@ public void StartProcessDumpWillStartProcDumpExeWithCorrectParamsAndGetDumpFileR } /// - /// StartProcessDump should start procdump binary with correct full dump arguments, while GetDumpFile returns full path + /// StartProcessDump should start proc dump binary with correct full dump arguments, while GetDumpFile returns full path /// [TestMethod] public void StartProcessDumpWillStartProcDumpExeWithCorrectParamsForFullDump() @@ -195,7 +195,7 @@ public void StartProcessDumpWillStartProcDumpExeWithCorrectParamsForFullDump() } /// - /// StartProcessDump should start procdump binary with correct arguments for hang based dump, while GetDumpFile returns full path + /// StartProcessDump should start proc dump binary with correct arguments for hang based dump, while GetDumpFile returns full path /// [TestMethod] public void StartProcessDumpForHangWillStartProcDumpExeWithCorrectParams() diff --git a/test/Microsoft.TestPlatform.ObjectModel.PlatformTests/DiaSessionTests.cs b/test/Microsoft.TestPlatform.ObjectModel.PlatformTests/DiaSessionTests.cs index ce293c0093..e9f6e23ed7 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.PlatformTests/DiaSessionTests.cs +++ b/test/Microsoft.TestPlatform.ObjectModel.PlatformTests/DiaSessionTests.cs @@ -76,7 +76,7 @@ public void GetNavigationDataShouldReturnCorrectDataForOverLoadedMethod() StringAssert.EndsWith(diaNavigationData.FileName, @"\SimpleClassLibrary\Class1.cs"); // Weird why DiaSession is now returning the first overloaded method - // as compared to before when it used to retun second method + // as compared to before when it used to return second method this.ValidateLineNumbers(diaNavigationData.MinLineNumber, diaNavigationData.MaxLineNumber); this.testEnvironment.TargetFramework = currentTargetFrameWork; diff --git a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Utilities/XmlRunSettingsUtilitiesTests.cs b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Utilities/XmlRunSettingsUtilitiesTests.cs index 82e472a863..f75beb8913 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Utilities/XmlRunSettingsUtilitiesTests.cs +++ b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Utilities/XmlRunSettingsUtilitiesTests.cs @@ -17,7 +17,7 @@ namespace Microsoft.TestPlatform.ObjectModel.UnitTests.Utilities [TestClass] public class XmlRunSettingsUtilitiesTests { - #region private variables + #region Private Variables private readonly string runSettingsXmlWithDataCollectors = @" diff --git a/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/TelemetryPerfTestBase.cs b/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/TelemetryPerfTestBase.cs index 1d5f1e41d0..65f882b653 100644 --- a/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/TelemetryPerfTestBase.cs +++ b/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/TelemetryPerfTestBase.cs @@ -27,7 +27,7 @@ public TelemetryPerfTestbase() } /// - /// Used for posting the telemtery to AppInsights + /// Used for posting the telemetry to AppInsights /// /// /// diff --git a/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DotnetTestHostManagerTests.cs b/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DotnetTestHostManagerTests.cs index bac05c8830..bd3f0ad26e 100644 --- a/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DotnetTestHostManagerTests.cs +++ b/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DotnetTestHostManagerTests.cs @@ -871,7 +871,7 @@ public async Task DotNetCoreProcessExitedButNoErrorMessageIfNoDataWritten(int ex var errorData = string.Empty; this.ExitCallBackTestHelper(exitCode); - // override event listner + // override event listener this.dotnetHostManager.HostExited += this.DotnetHostManagerExitCodeTesterHostExited; await this.dotnetHostManager.LaunchTestHostAsync(this.defaultTestProcessStartInfo, CancellationToken.None); diff --git a/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs b/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs index 9aa4880d2b..bdd9cf9567 100644 --- a/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs +++ b/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs @@ -232,12 +232,12 @@ public void StdErrorDoesNotContains(string substring) public void StdOutputContains(string substring) { - Assert.IsTrue(this.standardTestOutput.Contains(substring), $"StdOutout:{Environment.NewLine} Expected substring: {substring}{Environment.NewLine}Acutal string: {this.standardTestOutput}"); + Assert.IsTrue(this.standardTestOutput.Contains(substring), $"StdOutout:{Environment.NewLine} Expected substring: {substring}{Environment.NewLine}Actual string: {this.standardTestOutput}"); } public void StdOutputDoesNotContains(string substring) { - Assert.IsFalse(this.standardTestOutput.Contains(substring), $"StdOutout:{Environment.NewLine} Not expected substring: {substring}{Environment.NewLine}Acutal string: {this.standardTestOutput}"); + Assert.IsFalse(this.standardTestOutput.Contains(substring), $"StdOutout:{Environment.NewLine} Not expected substring: {substring}{Environment.NewLine}Actual string: {this.standardTestOutput}"); } public void ExitCodeEquals(int exitCode) @@ -256,7 +256,7 @@ public void ValidatePassedTests(params string[] passedTests) this.standardTestOutput = Regex.Replace(this.standardTestOutput, @"[^\x00-\x7F]", c => string.Format(@"\u{0:x4}", (int)c.Value[0])); foreach (var test in passedTests) { - // Check for tick or ? both, in some cases as unicode charater for tick is not available + // Check for tick or ? both, in some cases as unicode character for tick is not available // in std out and gets replaced by ? var flag = this.standardTestOutput.Contains("\\u221a " + test) || this.standardTestOutput.Contains("\\u221a " + GetTestMethodName(test)) @@ -620,7 +620,7 @@ private void FormatStandardOutCome() /// Destination runsettings path where resulted file saves /// /// - /// Contains run configuratin settings + /// Contains run configuration settings /// public static void CreateRunSettingsFile(string destinationRunsettingsPath, IDictionary runConfigurationDictionary) { diff --git a/test/Microsoft.TestPlatform.TestUtilities/PerfInstrumentation/PerfAnalyzer.cs b/test/Microsoft.TestPlatform.TestUtilities/PerfInstrumentation/PerfAnalyzer.cs index 5c804a10a8..d4ad706bbd 100644 --- a/test/Microsoft.TestPlatform.TestUtilities/PerfInstrumentation/PerfAnalyzer.cs +++ b/test/Microsoft.TestPlatform.TestUtilities/PerfInstrumentation/PerfAnalyzer.cs @@ -14,7 +14,7 @@ namespace Microsoft.TestPlatform.TestUtilities.PerfInstrumentation #endif /// - /// The perf analyzer. + /// The performance analyzer. /// public class PerfAnalyzer { diff --git a/test/Microsoft.TestPlatform.TestUtilities/PerfInstrumentation/PerformanceTestBase.cs b/test/Microsoft.TestPlatform.TestUtilities/PerfInstrumentation/PerformanceTestBase.cs index 93627db361..d08d473e4f 100644 --- a/test/Microsoft.TestPlatform.TestUtilities/PerfInstrumentation/PerformanceTestBase.cs +++ b/test/Microsoft.TestPlatform.TestUtilities/PerfInstrumentation/PerformanceTestBase.cs @@ -79,7 +79,7 @@ public void RunDiscoveryPerformanceTests(string testAsset, string testAdapterPat } /// - /// The analyze perf data. + /// The analyze performance data. /// public void AnalyzePerfData() { diff --git a/test/Microsoft.TestPlatform.Utilities.UnitTests/XmlUtilitiesTests.cs b/test/Microsoft.TestPlatform.Utilities.UnitTests/XmlUtilitiesTests.cs index 775e1435f4..76cc3772dc 100644 --- a/test/Microsoft.TestPlatform.Utilities.UnitTests/XmlUtilitiesTests.cs +++ b/test/Microsoft.TestPlatform.Utilities.UnitTests/XmlUtilitiesTests.cs @@ -206,7 +206,7 @@ public void RemoveChildNodeShouldRemoveXmlIfExist() #endregion - #region private methods + #region Private Methods private XmlDocument GetXmlDocument(string settingsXml) { diff --git a/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs b/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs index 844e681ce6..36f8c2adce 100644 --- a/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs +++ b/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs @@ -15,7 +15,7 @@ namespace Coverlet.Collector.DataCollection { // This class MUST have the same full name as // https://github.com/tonerdo/coverlet/blob/master/src/coverlet.collector/InProcDataCollection/CoverletInProcDataCollector.cs - // to mimic real behaviour + // to mimic real behavior public class CoverletInProcDataCollector : InProcDataCollection { public void Initialize(IDataCollectionSink dataCollectionSink) diff --git a/test/TranslationLayer.UnitTests/VsTestConsoleRequestSenderTests.cs b/test/TranslationLayer.UnitTests/VsTestConsoleRequestSenderTests.cs index 43d48d761a..c828477a6f 100644 --- a/test/TranslationLayer.UnitTests/VsTestConsoleRequestSenderTests.cs +++ b/test/TranslationLayer.UnitTests/VsTestConsoleRequestSenderTests.cs @@ -1899,7 +1899,7 @@ public async Task StartTestRunAsyncShouldLogErrorOnProcessExited() #endregion - #region private methods + #region Private Methods /// /// Serialize and Deserialize message as it would happen for real. diff --git a/test/testhost.UnitTests/DummyTests.cs b/test/testhost.UnitTests/DummyTests.cs index 67e20ea003..d7d43bd873 100644 --- a/test/testhost.UnitTests/DummyTests.cs +++ b/test/testhost.UnitTests/DummyTests.cs @@ -9,7 +9,7 @@ namespace testhost.UnitTests public class DummyTests { /// - /// This test is added as atleast one test is required for dotnet core tfm for test scripts to succeed. + /// This test is added as at least one test is required for dotnet core tfm for test scripts to succeed. /// [TestMethod] public void DummyUnitTest() diff --git a/test/vstest.console.PlatformTests/AssemblyMetadataProviderTests.cs b/test/vstest.console.PlatformTests/AssemblyMetadataProviderTests.cs index b08f04df9f..bd2144da42 100644 --- a/test/vstest.console.PlatformTests/AssemblyMetadataProviderTests.cs +++ b/test/vstest.console.PlatformTests/AssemblyMetadataProviderTests.cs @@ -168,7 +168,7 @@ private void TestDotnetAssemblyArch(string projectName, string framework, Archit private void LoadAssemblyIntoMemory(string assemblyPath) { - // Load the file into RAM in ahead to avoid perf number(expectedElapsedTime) dependence on disk read time. + // Load the file into RAM in ahead to avoid performance number(expectedElapsedTime) dependence on disk read time. File.ReadAllBytes(assemblyPath); } } diff --git a/test/vstest.console.UnitTests/ExecutorUnitTests.cs b/test/vstest.console.UnitTests/ExecutorUnitTests.cs index 2de09f151c..300f718e66 100644 --- a/test/vstest.console.UnitTests/ExecutorUnitTests.cs +++ b/test/vstest.console.UnitTests/ExecutorUnitTests.cs @@ -46,7 +46,7 @@ public void ExecutorPrintsSplashScreenTest() Assert.AreEqual(1, exitCode, "Exit code must be One for bad arguments"); // Verify that messages exist - Assert.IsTrue(mockOutput.Messages.Count > 0, "Executor must print atleast copyright info"); + Assert.IsTrue(mockOutput.Messages.Count > 0, "Executor must print at least copyright info"); Assert.IsNotNull(mockOutput.Messages.First().Message, "First Printed Message cannot be null or empty"); // Just check first 20 characters - don't need to check whole thing as assembly version is variable diff --git a/test/vstest.console.UnitTests/Processors/EnableCodeCoverageArgumentProcessorTests.cs b/test/vstest.console.UnitTests/Processors/EnableCodeCoverageArgumentProcessorTests.cs index 203578c586..9945a11e8e 100644 --- a/test/vstest.console.UnitTests/Processors/EnableCodeCoverageArgumentProcessorTests.cs +++ b/test/vstest.console.UnitTests/Processors/EnableCodeCoverageArgumentProcessorTests.cs @@ -86,7 +86,7 @@ public void InitializeShouldCreateEntryForCodeCoverageInRunSettingsIfNotAlreadyP Assert.IsNotNull(this.settingsProvider.ActiveRunSettings); var dataCollectorsFriendlyNames = XmlRunSettingsUtilities.GetDataCollectorsFriendlyName(this.settingsProvider.ActiveRunSettings.SettingsXml); - Assert.IsTrue(dataCollectorsFriendlyNames.Contains("Code Coverage"), "Code coverage setting in not avilabe in runsettings"); + Assert.IsTrue(dataCollectorsFriendlyNames.Contains("Code Coverage"), "Code coverage setting in not available in runsettings"); } [TestMethod] diff --git a/test/vstest.console.UnitTests/Processors/RunSpecificTestsArgumentProcessorTests.cs b/test/vstest.console.UnitTests/Processors/RunSpecificTestsArgumentProcessorTests.cs index 61ba0f3b42..a8a57b0658 100644 --- a/test/vstest.console.UnitTests/Processors/RunSpecificTestsArgumentProcessorTests.cs +++ b/test/vstest.console.UnitTests/Processors/RunSpecificTestsArgumentProcessorTests.cs @@ -319,7 +319,7 @@ public void ExecutorExecuteShouldForValidSourcesAndNoTestsDiscoveredShouldLogWar this.ResetAndAddSourceToCommandLineOptions(); - // Setting some testdapterpath + // Setting some test adapter path CommandLineOptions.Instance.TestAdapterPath = @"C:\Foo"; mockDiscoveryRequest.Setup(dr => dr.DiscoverAsync()).Raises(dr => dr.OnDiscoveredTests += null, new DiscoveredTestsEventArgs(new List())); From c27c689b6bb58efddd2ef178bf9508f5d65bce70 Mon Sep 17 00:00:00 2001 From: Maximilian Chaplin Date: Fri, 21 Feb 2020 22:06:38 +0100 Subject: [PATCH 2/3] major amount of whitespace fixes and some other spelling and convention fixes --- .../Microsoft.TestPlatform.E2ETest/Program.cs | 2 +- .../Communication/MessageType.cs | 8 +- .../SocketCommunicationManager.cs | 16 +- .../Payload/DiscoveryRequestPayload.cs | 4 +- .../Payload/TestRunRequestPayload.cs | 6 +- .../Program.cs | 8 +- .../RunnerProcessManager.cs | 4 +- .../ArgumentEscaper.cs | 2 +- .../Discovery/DiscoveryRequest.cs | 8 +- .../Execution/TestRunRequest.cs | 10 +- .../DataCollectionEnvironmentVariable.cs | 2 +- .../DataCollection/DataCollectionManager.cs | 2 +- .../DataCollection/DataCollectorConfig.cs | 2 +- .../DataCollectorInformation.cs | 2 +- .../TestPlatformDataCollectionLogger.cs | 2 +- .../TestPlatformDataCollectionSink.cs | 2 +- .../DataCollectionExtensionManager.cs | 2 +- .../TestDiscoveryExtensionManager.cs | 2 +- .../TestExecutorExtensionManager.cs | 4 +- .../TestExtensionManager.cs | 4 +- .../TestLoggerExtensionManager.cs | 4 +- .../TestPluginDiscoverer.cs | 4 +- .../TestDiscovererPluginInformation.cs | 4 +- .../Utilities/TestExtensions.cs | 4 +- .../Filtering/Condition.cs | 20 +- .../Filtering/FilterExpression.cs | 16 +- .../Filtering/FilterExpressionWrapper.cs | 8 +- .../Filtering/TestCaseFilterExpression.cs | 2 +- .../Hosting/TestRunTimeExtensionManager.cs | 2 +- .../Hosting/TestRunTimeMetadata.cs | 2 +- .../Hosting/TestRunTimeProviderManager.cs | 2 +- .../IParallelProxyDiscoveryManager.cs | 4 +- .../ClientProtocol/IProxyExecutionManager.cs | 4 +- .../ClientProtocol/TestExecutionContext.cs | 4 +- .../Engine/ITestCaseEventsHandler.cs | 2 +- .../Interfaces/ITestRunEventsRegistrar.cs | 2 +- .../SettingsProviderExtensionManager.cs | 6 +- .../Telemetry/NoOpMetricsCollection.cs | 2 +- .../Utilities/AssemblyProperties.cs | 2 +- .../Utilities/FakesUtilities.cs | 2 +- .../Utilities/RunSettingsUtilities.cs | 2 +- .../TestDiscoveryEventHandler.cs | 2 +- .../Messages/MessageType.cs | 2 +- .../Adapter/FrameworkHandle.cs | 14 +- .../Adapter/TestExecutionRecorder.cs | 12 +- .../ParallelDiscoveryDataAggregator.cs | 2 +- .../ParallelDiscoveryEventsHandler.cs | 10 +- .../Parallel/ParallelOperationManager.cs | 4 +- .../Parallel/ParallelProxyDiscoveryManager.cs | 8 +- .../Parallel/ParallelProxyExecutionManager.cs | 11 +- .../Parallel/ParallelRunDataAggregator.cs | 2 +- .../Parallel/ParallelRunEventsHandler.cs | 14 +- .../Client/ProxyExecutionManager.cs | 4 +- ...ProxyExecutionManagerWithDataCollection.cs | 4 +- .../Client/ProxyOperationManager.cs | 10 +- .../Client/TestRunCriteriaExtensions.cs | 10 +- .../DataCollectionTestRunEventsHandler.cs | 4 +- .../DefaultDataCollectionLauncher.cs | 4 +- .../DotnetDataCollectionLauncher.cs | 10 +- .../DataCollection/InProcDataCollector.cs | 4 +- .../Interfaces/IInProcDataCollector.cs | 2 +- .../ParallelDataCollectionEventsHandler.cs | 12 +- .../ProxyDataCollectionManager.cs | 2 +- .../Discovery/DiscoveryContext.cs | 2 +- .../Discovery/DiscoveryManager.cs | 7 +- .../Discovery/DiscoveryResultCache.cs | 12 +- .../Execution/ExecutionManager.cs | 5 +- .../Execution/RunTestsWithSources.cs | 2 +- .../Execution/TestRunCache.cs | 18 +- .../Interfaces/ITestRunCache.cs | 1 - .../TestEngine.cs | 2 +- .../Utilities/TestSourcesUtility.cs | 4 +- .../HtmlLogger.cs | 2 +- .../HtmlTransformer.cs | 2 +- .../ObjectModel/TestExecId.cs | 2 +- .../ObjectModel/TestOutcome.cs | 8 +- .../TrxLogger.cs | 4 +- .../Utility/Collection.cs | 6 +- .../Utility/Converter.cs | 2 +- .../Adapter/Interfaces/IDiscoveryContext.cs | 2 +- .../Adapter/Interfaces/IFrameworkHandle.cs | 6 +- .../Adapter/Interfaces/IRunContext.cs | 4 +- .../Adapter/Interfaces/ISettingsProvider.cs | 2 +- .../Interfaces/ITestCaseFilterExpression.cs | 2 +- .../Adapter/Interfaces/ITestDiscoverer.cs | 4 +- .../Adapter/Interfaces/ITestExecutor.cs | 12 +- .../Adapter/Interfaces/ITestLog.cs | 12 +- .../Adapter/TestsCanceledException.cs | 4 +- .../AttachmentSet.cs | 12 +- .../Client/DiscoveryCriteria.cs | 2 +- .../Events/DiscoveryCompleteEventArgs.cs | 2 +- .../Client/Events/TestRunCompleteEventArgs.cs | 10 +- .../Client/FilterOptions.cs | 28 +- .../Client/Interfaces/IDiscoveryRequest.cs | 4 +- .../Client/Interfaces/IRequest.cs | 2 +- .../Client/Interfaces/ITestPlatform.cs | 2 +- .../Interfaces/ITestRunConfiguration.cs | 16 +- .../Client/Interfaces/ITestRunRequest.cs | 2 +- .../Payloads/CustomHostLaunchAckPayload.cs | 4 +- .../Payloads/DiscoveryRequestPayload.cs | 4 +- .../Client/Payloads/TestRunRequestPayload.cs | 10 +- .../CodeCoverage/TestSDKAutoGeneratedCode.cs | 2 +- .../DataCollector/Common/FileHelper.cs | 8 +- .../DataCollector/DataCollectionContext.cs | 2 +- .../DataCollectionRunSettings.cs | 2 +- .../DataCollector/DataCollectionSink.cs | 2 +- .../Events/DataCollectionEvents.cs | 2 +- .../Events/TestHostLaunchedEvent.cs | 4 +- .../BaseTransferInformation.cs | 6 +- .../FileTransferInformation.cs | 6 +- .../DefaultExecutorUriAttribute.cs | 2 +- .../ExceptionConverter.cs | 4 +- .../FileExtensionAttribute.cs | 2 +- .../Host/ITestRunTimeProvider.cs | 2 +- .../Logging/Events/TestResultEventArgs.cs | 2 +- .../Logging/Events/TestRunMessageEventArgs.cs | 2 +- .../Logging/TestMessageLevel.cs | 4 +- .../Navigation/DiaNavigationData.cs | 6 +- .../Navigation/FullSymbolReader.cs | 8 +- .../Navigation/ISymbolReader.cs | 2 +- .../Navigation/NativeMethods.cs | 2 +- .../Navigation/PortablePdbReader.cs | 4 +- .../RegistryFreeActivationContext.cs | 8 +- .../RunSettings/RunConfiguration.cs | 12 +- .../RunSettings/SettingsNameAttribute.cs | 4 +- .../RunSettings/TestRunSettings.cs | 6 +- .../TestCase.cs | 4 +- .../TestObject.cs | 4 +- .../TestProperty/TestProperty.cs | 2 +- .../TestResult.cs | 2 +- .../Trait.cs | 2 +- .../Utilities/AssemblyHelper.cs | 24 +- .../Utilities/AssemblyLoadWorker.cs | 32 +- .../Utilities/FilterHelper.cs | 6 +- .../Utilities/XmlReaderUtilities.cs | 2 +- .../Utilities/XmlRunSettingsUtilities.cs | 6 +- .../Hosting/DotnetTestHostManager.cs | 2 +- .../InferRunSettingsHelper.cs | 8 +- .../MSTestSettingsUtilities.cs | 6 +- .../XmlUtilities.cs | 2 +- .../Interfaces/IProcessManager.cs | 4 +- .../ITranslationLayerRequestSender.cs | 6 +- .../VsTestConsoleProcessManager.cs | 2 +- .../VsTestConsoleRequestSender.cs | 4 +- src/testhost.x86/AppDomainEngineInvoker.cs | 6 +- src/testhost.x86/Program.cs | 6 +- .../CommandLine/CommandArgumentPair.cs | 6 +- .../CommandLine/CommandLineOptions.cs | 8 +- src/vstest.console/CommandLine/Executor.cs | 4 +- src/vstest.console/Internal/ConsoleLogger.cs | 4 +- .../Processors/CollectArgumentProcessor.cs | 2 +- .../Processors/FrameworkArgumentProcessor.cs | 2 +- ...istFullyQualifiedTestsArgumentProcessor.cs | 1 - .../ListTestsTargetPathArgumentProcessor.cs | 2 +- .../Processors/PlatformArgumentProcessor.cs | 1 - .../Processors/RunTestsArgumentProcessor.cs | 4 +- .../TestAdapterPathArgumentProcessor.cs | 2 +- .../TestCaseFilterArgumentProcessor.cs | 4 +- .../Processors/TestSourceArgumentProcessor.cs | 2 +- .../UseVsixExtensionsArgumentProcessor.cs | 2 +- .../Utilities/ArgumentProcessorFactory.cs | 2 +- .../TestPlatformHelpers/TestRequestManager.cs | 6 +- .../VanguardTests.cs | 2 +- .../EventLogCollectorTests.cs | 32 +- .../NetCoreTargetFrameworkDataSource.cs | 2 +- .../NetFullTargetFrameworkDataSource.cs | 2 +- .../LoggerTests.cs | 6 +- .../Program.cs | 2 +- .../RunsettingsTests.cs | 10 +- .../TranslationLayerTests/DiscoverTests.cs | 8 +- .../TranslationLayerTests/RunTests.cs | 2 +- .../DesignMode/DesignModeClientTests.cs | 8 +- .../DesignModeTestHostLauncherFactoryTests.cs | 2 +- .../Program.cs | 2 +- .../TestPluginManagerTests.cs | 2 +- .../Utilities/LazyExtensionTests.cs | 2 +- .../TestDiscovererPluginInformationTests.cs | 4 +- .../TestExtensionPluginInformationTests.cs | 4 +- .../Utilities/TestPluginInformationTests.cs | 2 +- ...tSettingsProviderPluginInformationTests.cs | 2 +- .../TestCaseFilterExpressionTests.cs | 2 +- .../Logging/InternalTestLoggerEventsTests.cs | 2 +- .../Program.cs | 2 +- .../RunSettingsTests.cs | 2 +- .../SettingsProviderExtensionManagerTests.cs | 2 +- .../Utilities/FakesUtilitiesTests.cs | 2 +- .../Utilities/JobQueueTests.cs | 24 +- .../Adapter/TestExecutionRecorderTests.cs | 2 +- .../ParallelDiscoveryEventsHandlerTests.cs | 4 +- .../Parallel/ParallelOperationManagerTests.cs | 2 +- .../ParallelProxyExecutionManagerTests.cs | 4 +- .../Parallel/ParallelRunEventsHandlerTests.cs | 10 +- .../Client/ProxyDiscoveryManagerTests.cs | 4 +- ...ProcDataCollectionExtensionManagerTests.cs | 2 +- .../InProcDataCollectionSinkTests.cs | 2 +- .../Discovery/DiscoveryManagerTests.cs | 2 +- .../Discovery/DiscoveryResultCacheTests.cs | 2 +- .../Discovery/TestCaseDiscoverySinkTests.cs | 2 +- .../Execution/ExecutionManagerTests.cs | 4 +- .../Execution/RunTestsWithSourcesTests.cs | 4 +- .../Execution/RunTestsWithTestsTests.cs | 4 +- .../Execution/TestRunCacheTests.cs | 2 +- .../Program.cs | 2 +- .../TestLoggerManagerTests.cs | 46 +- .../TestableTestRunCache.cs | 2 +- .../Program.cs | 2 +- .../Client/TestRunCriteriaTests.cs | 2 +- .../CustomStringArrayConverterTests.cs | 1 - .../Program.cs | 2 +- .../RunSettings/RunConfigurationTests.cs | 8 +- .../TestCaseTests.cs | 6 +- .../Utilities/FilterHelperTests.cs | 4 +- .../Utilities/XmlRunSettingsUtilitiesTests.cs | 2 +- .../Program.cs | 2 +- .../ProtocolV2Tests.cs | 8 +- .../TranslationLayer/DiscoveryPerfTests.cs | 2 +- .../EventHandler/DiscoveryEventHandler.cs | 1 - .../TranslationLayer/TelemetryPerfTestBase.cs | 2 +- .../Program.cs | 2 +- .../IntegrationTestBase.cs | 10 +- .../PerformanceTestBase.cs | 2 +- .../InferRunSettingsHelperTests.cs | 1608 +++--- .../Program.cs | 2 +- .../UnitTest1.cs | 8 +- .../CoverletInProcDataCollector.cs | 2 +- test/TranslationLayer.UnitTests/Program.cs | 2 +- .../VsTestConsoleRequestSenderTests.cs | 4 +- ...ataCollector.cs => CustomDataCollector.cs} | 0 .../AppDomainEngineInvokerTests.cs | 10 +- test/testhost.UnitTests/Program.cs | 2 +- .../CommandLine/CommandLineOptionsTests.cs | 8 +- .../TestRunResultAggregatorTests.cs | 4 +- .../ExceptionUtilities.cs | 2 +- .../Internal/ConsoleLoggerTests.cs | 3 - .../Internal/FilePatternParserTests.cs | 2 +- .../Internal/ProgressIndicatorTests.cs | 2 +- ...stTestsTargetPathArgumentProcessorTests.cs | 2 +- .../RunSettingsArgumentProcessorTests.cs | 4 +- .../TestCaseFilterArgumentProcessorTests.cs | 2 - .../TextFileTelemetryPublisherTests.cs | 8 +- .../TestRequestManagerTests.cs | 4436 ++++++++--------- 241 files changed, 3614 insertions(+), 3631 deletions(-) rename test/datacollector.PlatformTests/{CutomDataCollector.cs => CustomDataCollector.cs} (100%) diff --git a/samples/Microsoft.TestPlatform.E2ETest/Program.cs b/samples/Microsoft.TestPlatform.E2ETest/Program.cs index 995f812652..b893a27e6c 100644 --- a/samples/Microsoft.TestPlatform.E2ETest/Program.cs +++ b/samples/Microsoft.TestPlatform.E2ETest/Program.cs @@ -6,7 +6,7 @@ namespace Microsoft.TestPlatform.E2ETest using Microsoft.VisualStudio.TestPlatform.CoreUtilities.Extensions; using System.Diagnostics; using System.IO; - + public class Program { public static void Main(string[] args) diff --git a/samples/Microsoft.TestPlatform.Protocol/Communication/MessageType.cs b/samples/Microsoft.TestPlatform.Protocol/Communication/MessageType.cs index b37d567cd7..b65dc4b8f2 100644 --- a/samples/Microsoft.TestPlatform.Protocol/Communication/MessageType.cs +++ b/samples/Microsoft.TestPlatform.Protocol/Communication/MessageType.cs @@ -47,7 +47,7 @@ public static class MessageType /// The discovery started. /// public const string StartDiscovery = "TestDiscovery.Start"; - + /// /// The test cases found. /// @@ -104,12 +104,12 @@ public static class MessageType public const string GetTestRunnerProcessStartInfoForRunSelected = "TestExecution.GetTestRunnerProcessStartInfoForRunSelected"; /// - /// CustomTestHostLaunch + /// CustomTestHostLaunch /// public const string CustomTestHostLaunch = "TestExecution.CustomTestHostLaunch"; /// - /// Custom Test Host launch callback + /// Custom Test Host launch callback /// public const string CustomTestHostLaunchCallback = "TestExecution.CustomTestHostLaunchCallback"; @@ -119,7 +119,7 @@ public static class MessageType public const string ExtensionsInitialize = "Extensions.Initialize"; /// - /// Start Test Run All Sources + /// Start Test Run All Sources /// public const string TestRunAllSourcesWithDefaultHost = "TestExecution.RunAllWithDefaultHost"; diff --git a/samples/Microsoft.TestPlatform.Protocol/Communication/SocketCommunicationManager.cs b/samples/Microsoft.TestPlatform.Protocol/Communication/SocketCommunicationManager.cs index 0cc1b5a3ae..f1353c2d72 100644 --- a/samples/Microsoft.TestPlatform.Protocol/Communication/SocketCommunicationManager.cs +++ b/samples/Microsoft.TestPlatform.Protocol/Communication/SocketCommunicationManager.cs @@ -9,17 +9,17 @@ namespace Microsoft.TestPlatform.Protocol using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; - + /// /// Facilitates communication using sockets - /// + /// public class SocketCommunicationManager { /// /// TCP Listener to host TCP channel and listen /// private TcpListener tcpListener; - + /// /// Binary Writer to write to channel stream /// @@ -39,9 +39,9 @@ public class SocketCommunicationManager /// Event used to maintain client connection state /// private ManualResetEvent clientConnectedEvent = new ManualResetEvent(false); - + /// - /// Sync object for sending messages + /// Sync object for sending messages /// SendMessage over socket channel is NOT thread-safe /// private object sendSyncObject = new object(); @@ -130,7 +130,7 @@ public void StopServer() } #endregion - + /// /// Writes message to the binary writer. /// @@ -181,7 +181,7 @@ public string ReceiveRawMessage() Console.WriteLine(rawMessage); return rawMessage; } - + /// /// Deserializes the Message into actual TestPlatform objects /// @@ -192,7 +192,7 @@ public T DeserializePayload(Message message) { return this.dataSerializer.DeserializePayload(message); } - + /// /// Writes the data on socket and flushes the buffer /// diff --git a/samples/Microsoft.TestPlatform.Protocol/Payload/DiscoveryRequestPayload.cs b/samples/Microsoft.TestPlatform.Protocol/Payload/DiscoveryRequestPayload.cs index e2a360e745..578fa9f05c 100644 --- a/samples/Microsoft.TestPlatform.Protocol/Payload/DiscoveryRequestPayload.cs +++ b/samples/Microsoft.TestPlatform.Protocol/Payload/DiscoveryRequestPayload.cs @@ -12,13 +12,13 @@ namespace Microsoft.TestPlatform.Protocol public class DiscoveryRequestPayload { /// - /// Settings used for the discovery request. + /// Settings used for the discovery request. /// [DataMember] public IEnumerable Sources { get; set; } /// - /// Settings used for the discovery request. + /// Settings used for the discovery request. /// [DataMember] public string RunSettings { get; set; } diff --git a/samples/Microsoft.TestPlatform.Protocol/Payload/TestRunRequestPayload.cs b/samples/Microsoft.TestPlatform.Protocol/Payload/TestRunRequestPayload.cs index 5cebd391c6..8683719d17 100644 --- a/samples/Microsoft.TestPlatform.Protocol/Payload/TestRunRequestPayload.cs +++ b/samples/Microsoft.TestPlatform.Protocol/Payload/TestRunRequestPayload.cs @@ -24,19 +24,19 @@ public class TestRunRequestPayload public dynamic TestCases { get; set; } /// - /// Gets or sets the settings used for the test run request. + /// Gets or sets the settings used for the test run request. /// [DataMember] public string RunSettings { get; set; } /// - /// Settings used for the Run request. + /// Settings used for the Run request. /// [DataMember] public bool KeepAlive { get; set; } /// - /// Is Debugging enabled + /// Is Debugging enabled /// [DataMember] public bool DebuggingEnabled { get; set; } diff --git a/samples/Microsoft.TestPlatform.Protocol/Program.cs b/samples/Microsoft.TestPlatform.Protocol/Program.cs index 63b6f03cbd..9e99b44bde 100644 --- a/samples/Microsoft.TestPlatform.Protocol/Program.cs +++ b/samples/Microsoft.TestPlatform.Protocol/Program.cs @@ -110,7 +110,7 @@ public static int Main(string[] args) case "discovery": discoveredTestCases = DiscoverTests(testadapterPath, testAssembly, settingsXml); break; - + case "runselected": discoveredTestCases = DiscoverTests(testadapterPath, testAssembly, settingsXml); RunSelectedTests(discoveredTestCases, settingsXml); @@ -180,7 +180,7 @@ static dynamic DiscoverTests(string testadapterPath, string testAssembly, string { dynamic discoveryCompletePayload = JsonDataSerializer.Instance.DeserializePayload(message); - + // Handle discovery complete here isDiscoveryComplete = true; } @@ -193,14 +193,14 @@ static dynamic DiscoverTests(string testadapterPath, string testAssembly, string return testCases; } - + static void RunAllTests(List sources, string settingsXml) { Console.WriteLine("Starting Operation: RunAll"); communicationManager.SendMessage(MessageType.TestRunAllSourcesWithDefaultHost, new TestRunRequestPayload() { Sources = sources, RunSettings = settingsXml }); RecieveRunMesagesAndHandleRunComplete(); } - + static void RunSelectedTests(dynamic testCases, string settingsXml) { Console.WriteLine("Starting Operation: RunSelected"); diff --git a/samples/Microsoft.TestPlatform.Protocol/RunnerProcessManager.cs b/samples/Microsoft.TestPlatform.Protocol/RunnerProcessManager.cs index f324517b3e..cf089e3c4c 100644 --- a/samples/Microsoft.TestPlatform.Protocol/RunnerProcessManager.cs +++ b/samples/Microsoft.TestPlatform.Protocol/RunnerProcessManager.cs @@ -47,7 +47,7 @@ public void StartProcess(string[] args) { this.process = new Process(); process.StartInfo.FileName = GetDotnetHostFullPath(); - + if (args != null) { process.StartInfo.Arguments = args.Length < 2 ? args[0] : string.Join(" ", args); @@ -56,7 +56,7 @@ public void StartProcess(string[] args) process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = true; - + process.Start(); process.EnableRaisingEvents = true; process.Exited += Process_Exited; diff --git a/src/Microsoft.TestPlatform.Build/ArgumentEscaper.cs b/src/Microsoft.TestPlatform.Build/ArgumentEscaper.cs index 3bd5dbc2ce..a203b25bb0 100644 --- a/src/Microsoft.TestPlatform.Build/ArgumentEscaper.cs +++ b/src/Microsoft.TestPlatform.Build/ArgumentEscaper.cs @@ -9,7 +9,7 @@ public static class ArgumentEscaper /// /// Undo the processing which took place to create string[] args in Main, /// so that the next process will receive the same string[] args - /// + /// /// See here for more info: /// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx /// diff --git a/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs b/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs index 1a6ca24394..cf01e11821 100644 --- a/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs +++ b/src/Microsoft.TestPlatform.Client/Discovery/DiscoveryRequest.cs @@ -159,7 +159,7 @@ bool IRequest.WaitForCompletion(int timeout) throw new ObjectDisposedException("DiscoveryRequest"); } - // This method is not synchronized as it can lead to dead-lock + // This method is not synchronized as it can lead to dead-lock // (the discoveryCompletionEvent cannot be raised unless that lock is released) if (this.discoveryCompleted != null) { @@ -186,7 +186,7 @@ bool IRequest.WaitForCompletion(int timeout) public event EventHandler OnDiscoveryMessage; /// - /// Raised when new tests are discovered in this discovery request. + /// Raised when new tests are discovered in this discovery request. /// public event EventHandler OnDiscoveredTests; @@ -264,8 +264,8 @@ public void HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryComplete try { - // Raise onDiscoveredTests event if there are some tests in the last chunk. - // (We don't want to send the tests in the discovery complete event so that programming on top of + // Raise onDiscoveredTests event if there are some tests in the last chunk. + // (We don't want to send the tests in the discovery complete event so that programming on top of // RS client is easier i.e. user does not have to listen on discovery complete event.) if (lastChunk != null && lastChunk.Count() > 0) { diff --git a/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs b/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs index aac93dcafa..0c4a3c9fbc 100644 --- a/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs +++ b/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs @@ -218,11 +218,11 @@ public bool WaitForCompletion(int timeout) || this.State == TestRunState.Canceled || this.State == TestRunState.Aborted)) { - // If run is already terminated, then we should not throw an exception. + // If run is already terminated, then we should not throw an exception. throw new InvalidOperationException(ClientResources.WaitForCompletionOperationIsNotAllowedWhenNoTestRunIsActive); } - // This method is not synchronized as it can lead to dead-lock + // This method is not synchronized as it can lead to dead-lock // (the runCompletionEvent cannot be raised unless that lock is released) // Wait for run completion (In case m_runCompletionEvent is closed, then waitOne will throw nice error) @@ -337,7 +337,7 @@ public ITestRunConfiguration TestRunConfiguration /// /// Raised when a test run event raw message is received from host /// This is required if one wants to re-direct the message over the process boundary without any processing overhead - /// All the run events should come as raw messages as well as proper serialized events like OnRunStatsChange + /// All the run events should come as raw messages as well as proper serialized events like OnRunStatsChange /// public event EventHandler OnRawMessageReceived; @@ -432,7 +432,7 @@ public void HandleTestRunComplete(TestRunCompleteEventArgs runCompleteArgs, Test runContextAttachments != null ? new Collection(runContextAttachments.ToList()) : null, this.runRequestTimeTracker.Elapsed); - // Ignore the time sent (runCompleteArgs.ElapsedTimeInRunningTests) + // Ignore the time sent (runCompleteArgs.ElapsedTimeInRunningTests) // by either engines - as both calculate at different points // If we use them, it would be an incorrect comparison between TAEF and Rocksteady this.LoggerManager.HandleTestRunComplete(runCompletedEvent); @@ -507,7 +507,7 @@ public virtual void HandleTestRunStatsChange(TestRunChangedEventArgs testRunChan return; } - // TODO: Invoke this event in a separate thread. + // TODO: Invoke this event in a separate thread. // For now, I am setting the ConcurrencyMode on the callback attribute to Multiple this.LoggerManager.HandleTestRunStatsChange(testRunChangedArgs); this.OnRunStatsChange.SafeInvoke(this, testRunChangedArgs, "TestRun.RunStatsChanged"); diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionEnvironmentVariable.cs b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionEnvironmentVariable.cs index 309f5d95c9..bec2b004ca 100644 --- a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionEnvironmentVariable.cs +++ b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionEnvironmentVariable.cs @@ -32,7 +32,7 @@ internal class DataCollectionEnvironmentVariable #region Constructors /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Variable name and requested value. diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs index a7c44bbaff..dbebbe63f9 100644 --- a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs +++ b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs @@ -648,7 +648,7 @@ private void AddCollectorEnvironmentVariables( } else { - // Data collector is overriding an already requested variable, possibly an error. + // Data collector is overriding an already requested variable, possibly an error. dataCollectionWrapper.Logger.LogError( this.dataCollectionEnvironmentContext.SessionDataCollectionContext, string.Format( diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorConfig.cs b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorConfig.cs index 6fd7e1eb70..74378d5fd7 100644 --- a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorConfig.cs +++ b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorConfig.cs @@ -110,7 +110,7 @@ private static string GetFriendlyName(Type dataCollectorType) return friendlyName; } - + /// /// Gets the attributes of the specified type from the data collector type. /// diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorInformation.cs b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorInformation.cs index 3f851b6d13..5b04927b0b 100644 --- a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorInformation.cs +++ b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorInformation.cs @@ -7,7 +7,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.DataCollector using System.Collections.Generic; using System.Xml; using System.IO; - + using Microsoft.VisualStudio.TestPlatform.Common.DataCollector.Interfaces; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionLogger.cs b/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionLogger.cs index 5527f0c3a9..2f0f5beed3 100644 --- a/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionLogger.cs +++ b/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionLogger.cs @@ -28,7 +28,7 @@ internal class TestPlatformDataCollectionLogger : DataCollectionLogger private readonly IMessageSink sink; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The underlying raw IMessageSink. Cannot be null. diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionSink.cs b/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionSink.cs index cde5cf40c9..0caf6ec33c 100644 --- a/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionSink.cs +++ b/src/Microsoft.TestPlatform.Common/DataCollection/TestPlatformDataCollectionSink.cs @@ -16,7 +16,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.DataCollector internal class TestPlatformDataCollectionSink : DataCollectionSink { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Creates a data collector sink for data transfer. /// /// diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/DataCollectionExtensionManager.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/DataCollectionExtensionManager.cs index 631e9dcaac..37286096d2 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/DataCollectionExtensionManager.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/DataCollectionExtensionManager.cs @@ -72,7 +72,7 @@ public class DataCollectorMetadata : IDataCollectorCapabilities /// Constructor for DataCollectorMetadata /// /// - /// Uri identifying the data collector. + /// Uri identifying the data collector. /// /// /// The friendly Name. diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestDiscoveryExtensionManager.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestDiscoveryExtensionManager.cs index c8d9acd034..52dfd13e0b 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestDiscoveryExtensionManager.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestDiscoveryExtensionManager.cs @@ -68,7 +68,7 @@ protected TestDiscoveryExtensionManager( /// Instance of the Test Discovery Extension Manager /// /// - /// This would provide a discovery extension manager where extensions in + /// This would provide a discovery extension manager where extensions in /// all the extension assemblies are discovered. This is cached. /// public static TestDiscoveryExtensionManager Create() diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestExecutorExtensionManager.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestExecutorExtensionManager.cs index 4701aa10a4..30c822c6a0 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestExecutorExtensionManager.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestExecutorExtensionManager.cs @@ -132,8 +132,8 @@ internal static void LoadAndInitializeAllExtensions(bool shouldThrowOnError) { foreach (var executor in executorExtensionManager.TestExtensions) { - // Note: - The below Verbose call should not be under IsVerboseEnabled check as we want to - // call executor.Value even if logging is not enabled. + // Note: - The below Verbose call should not be under IsVerboseEnabled check as we want to + // call executor.Value even if logging is not enabled. EqtTrace.Verbose("TestExecutorExtensionManager: Loading executor {0}", executor.Value); } } diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestExtensionManager.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestExtensionManager.cs index 54c3782af9..034f9df22a 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestExtensionManager.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestExtensionManager.cs @@ -14,7 +14,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework using CommonResources = Microsoft.VisualStudio.TestPlatform.Common.Resources.Resources; /// - /// Generic base class for managing extensions and looking them up by their URI. + /// Generic base class for managing extensions and looking them up by their URI. /// /// The type of the extension. /// The type of the metadata. @@ -144,7 +144,7 @@ public LazyExtension TryGetTestExtension(string extension } #endregion - + /// /// Populate the extension map. /// diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestLoggerExtensionManager.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestLoggerExtensionManager.cs index b9979204f3..f49161fcbf 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestLoggerExtensionManager.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestLoggerExtensionManager.cs @@ -18,7 +18,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework internal class TestLoggerExtensionManager : TestExtensionManager { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The unfiltered Test Extensions. @@ -72,7 +72,7 @@ public class TestLoggerMetadata : ITestLoggerCapabilities /// Constructor for TestLoggerMetadata /// /// - /// Uri identifying the logger. + /// Uri identifying the logger. /// /// /// The friendly Name. diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs index 5852498f71..0a34fbfc57 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs @@ -30,14 +30,14 @@ internal class TestPluginDiscoverer private static List UnloadableFiles = new List(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public TestPluginDiscoverer() : this(new FileHelper()) { } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The file Helper. diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestDiscovererPluginInformation.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestDiscovererPluginInformation.cs index 60209d116f..a85a225f7d 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestDiscovererPluginInformation.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestDiscovererPluginInformation.cs @@ -78,7 +78,7 @@ public AssemblyType AssemblyType private static List GetFileExtensions(Type testDicovererType) { var fileExtensions = new List(); - + var attributes = testDicovererType.GetTypeInfo().GetCustomAttributes(typeof(FileExtensionAttribute), false).ToArray(); if (attributes != null && attributes.Length > 0) { @@ -103,7 +103,7 @@ private static List GetFileExtensions(Type testDicovererType) private static string GetDefaultExecutorUri(Type testDiscovererType) { string result = string.Empty; - + object[] attributes = testDiscovererType.GetTypeInfo().GetCustomAttributes(typeof(DefaultExecutorUriAttribute), false).ToArray(); if (attributes != null && attributes.Length > 0) { diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensions.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensions.cs index 45c9e972a2..dc69612880 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensions.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensions.cs @@ -62,7 +62,7 @@ public class TestExtensions /// /// Gets or sets test logger extensions. /// - internal Dictionary TestHosts { get; set; } + internal Dictionary TestHosts { get; set; } /// /// Gets or sets a value indicating whether are test hosts cached. @@ -159,7 +159,7 @@ internal TestExtensions GetExtensionsDiscoveredFromAssembly(string extensionAsse testExtensions.DataCollectors = this.GetExtensionsDiscoveredFromAssembly( this.DataCollectors, - extensionAssembly); + extensionAssembly); if (testExtensions.TestDiscoverers.Any() || testExtensions.TestExecutors.Any() || testExtensions.TestSettingsProviders.Any() || testExtensions.TestLoggers.Any() || testExtensions.TestHosts.Any() || testExtensions.DataCollectors.Any()) diff --git a/src/Microsoft.TestPlatform.Common/Filtering/Condition.cs b/src/Microsoft.TestPlatform.Common/Filtering/Condition.cs index f6678292cb..6eb059fab0 100644 --- a/src/Microsoft.TestPlatform.Common/Filtering/Condition.cs +++ b/src/Microsoft.TestPlatform.Common/Filtering/Condition.cs @@ -118,8 +118,8 @@ internal bool Evaluate(Func propertyValueProvider) case Operation.NotEqual: // all values in multi-valued property should not match 'this.Value' for NotEqual to evaluate true. - result = true; - + result = true; + // if value is null. if (null != multiValue) { @@ -169,7 +169,7 @@ internal bool Evaluate(Func propertyValueProvider) break; } return result; - } + } /// /// Returns a condition object after parsing input string of format 'Operation' @@ -212,7 +212,7 @@ private static void ThrownFormatExceptionForInvalidCondition(string conditionStr { throw new FormatException(string.Format(CultureInfo.CurrentCulture, CommonResources.TestCaseFilterFormatException, string.Format(CultureInfo.CurrentCulture, CommonResources.InvalidCondition, conditionString))); - } + } /// /// Check if condition validates any property in properties. @@ -233,7 +233,7 @@ internal bool ValidForProperties(IEnumerable properties, Func propertyProvider) { bool valid = true; @@ -241,7 +241,7 @@ private bool ValidForContainsOperation(Func propertyProvid // It is OK for propertyProvider to be null, no syntax check will happen. // Check validity of operator only if related TestProperty is non-null. - // if null, it might be custom validation ignore it. + // if null, it might be custom validation ignore it. if (null != propertyProvider) { TestProperty testProperty = propertyProvider(Name); @@ -295,7 +295,7 @@ private string[] GetPropertyValue(Func propertyValueProvider) } return null; - } + } internal static IEnumerable TokenizeFilterConditionString(string str) { @@ -318,14 +318,14 @@ IEnumerable TokenizeFilterConditionStringWorker(string s) if (last == FilterHelper.EscapeCharacter) { // Don't check if `current` is one of the special characters here. - // Instead, we blindly let any character follows '\' pass though and + // Instead, we blindly let any character follows '\' pass though and // relies on `FilterHelpers.Unescape` to report such errors. tokenBuilder.Append(current); if (current == FilterHelper.EscapeCharacter) { - // We just encountered double backslash (i.e. escaped '\'), therefore set `last` to '\0' - // so the second '\' (i.e. current) will not be treated as the prefix of escape sequence + // We just encountered double backslash (i.e. escaped '\'), therefore set `last` to '\0' + // so the second '\' (i.e. current) will not be treated as the prefix of escape sequence // in next iteration. current = '\0'; } diff --git a/src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs b/src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs index 6e9f211300..ef5fb5c23c 100644 --- a/src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs +++ b/src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs @@ -61,10 +61,10 @@ private FilterExpression(Condition condition) ValidateArg.NotNull(condition, nameof(condition)); this.condition = condition; } - #endregion + #endregion /// - /// Create a new filter expression 'And'ing 'this' with 'filter'. + /// Create a new filter expression 'And'ing 'this' with 'filter'. /// private FilterExpression And(FilterExpression filter) { @@ -72,7 +72,7 @@ private FilterExpression And(FilterExpression filter) } /// - /// Create a new filter expression 'Or'ing 'this' with 'filter'. + /// Create a new filter expression 'Or'ing 'this' with 'filter'. /// private FilterExpression Or(FilterExpression filter) { @@ -80,7 +80,7 @@ private FilterExpression Or(FilterExpression filter) } /// - /// Process the given operator from the filterStack. + /// Process the given operator from the filterStack. /// Puts back the result of operation back to filterStack. /// private static void ProcessOperator(Stack filterStack, Operator op) @@ -266,7 +266,7 @@ internal static FilterExpression Parse(string filterString, out FastFilter fastF { throw new FormatException(string.Format(CultureInfo.CurrentCulture, CommonResources.TestCaseFilterFormatException, CommonResources.MissingOperator)); } - + fastFilter = fastFilterBuilder.ToFastFilter(); return filterStack.Pop(); @@ -301,7 +301,7 @@ internal bool Evaluate(Func propertyValueProvider) } } return filterResult; - } + } internal static IEnumerable TokenizeFilterExpressionString(string str) { @@ -324,13 +324,13 @@ IEnumerable TokenizeFilterExpressionStringHelper(string s) if (last == FilterHelper.EscapeCharacter) { // Don't check if `current` is one of the special characters here. - // Instead, we blindly let any character follows '\' pass though and + // Instead, we blindly let any character follows '\' pass though and // relies on `FilterHelpers.Unescape` to report such errors. tokenBuilder.Append(current); if (current == FilterHelper.EscapeCharacter) { - // We just encountered "\\" (escaped '\'), this will set last to '\0' + // We just encountered "\\" (escaped '\'), this will set last to '\0' // so the next char will not be treated as a suffix of escape sequence. current = '\0'; } diff --git a/src/Microsoft.TestPlatform.Common/Filtering/FilterExpressionWrapper.cs b/src/Microsoft.TestPlatform.Common/Filtering/FilterExpressionWrapper.cs index 7899145a59..fa4648e554 100644 --- a/src/Microsoft.TestPlatform.Common/Filtering/FilterExpressionWrapper.cs +++ b/src/Microsoft.TestPlatform.Common/Filtering/FilterExpressionWrapper.cs @@ -29,7 +29,7 @@ public class FilterExpressionWrapper private bool UseFastFilter => this.fastFilter != null; /// - /// Initializes FilterExpressionWrapper with given filterString and options. + /// Initializes FilterExpressionWrapper with given filterString and options. /// public FilterExpressionWrapper(string filterString, FilterOptions options) { @@ -47,7 +47,7 @@ public FilterExpressionWrapper(string filterString, FilterOptions options) { this.filterExpression = null; - // Property value regex is only supported for fast filter, + // Property value regex is only supported for fast filter, // so we ignore it if no fast filter is constructed. // TODO: surface an error message to suer. @@ -73,7 +73,7 @@ public FilterExpressionWrapper(string filterString, FilterOptions options) } /// - /// Initializes FilterExpressionWrapper with given filterString. + /// Initializes FilterExpressionWrapper with given filterString. /// public FilterExpressionWrapper(string filterString) : this(filterString, null) @@ -121,7 +121,7 @@ public string[] ValidForProperties(IEnumerable supportedProperties, Func public bool Evaluate(Func propertyValueProvider) { ValidateArg.NotNull(propertyValueProvider, nameof(propertyValueProvider)); - + if (UseFastFilter) { return this.fastFilter.Evaluate(propertyValueProvider); diff --git a/src/Microsoft.TestPlatform.Common/Filtering/TestCaseFilterExpression.cs b/src/Microsoft.TestPlatform.Common/Filtering/TestCaseFilterExpression.cs index db28a9c25d..54cb6bc8ce 100644 --- a/src/Microsoft.TestPlatform.Common/Filtering/TestCaseFilterExpression.cs +++ b/src/Microsoft.TestPlatform.Common/Filtering/TestCaseFilterExpression.cs @@ -17,7 +17,7 @@ public class TestCaseFilterExpression : ITestCaseFilterExpression private FilterExpressionWrapper filterWrapper; /// - /// If filter Expression is valid for performing TestCase matching + /// If filter Expression is valid for performing TestCase matching /// (has only supported properties, syntax etc) /// private readonly bool validForMatch; diff --git a/src/Microsoft.TestPlatform.Common/Hosting/TestRunTimeExtensionManager.cs b/src/Microsoft.TestPlatform.Common/Hosting/TestRunTimeExtensionManager.cs index b36bd949e7..c150d1f5aa 100644 --- a/src/Microsoft.TestPlatform.Common/Hosting/TestRunTimeExtensionManager.cs +++ b/src/Microsoft.TestPlatform.Common/Hosting/TestRunTimeExtensionManager.cs @@ -18,7 +18,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.Hosting internal class TestRuntimeExtensionManager : TestExtensionManager { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Default constructor. /// /// diff --git a/src/Microsoft.TestPlatform.Common/Hosting/TestRunTimeMetadata.cs b/src/Microsoft.TestPlatform.Common/Hosting/TestRunTimeMetadata.cs index b7d8c6df92..441b2e6c95 100644 --- a/src/Microsoft.TestPlatform.Common/Hosting/TestRunTimeMetadata.cs +++ b/src/Microsoft.TestPlatform.Common/Hosting/TestRunTimeMetadata.cs @@ -14,7 +14,7 @@ public class TestRuntimeMetadata : ITestRuntimeCapabilities /// Constructor for TestRuntimeMetadata /// /// - /// Uri identifying the testhost. + /// Uri identifying the testhost. /// /// /// The friendly Name. diff --git a/src/Microsoft.TestPlatform.Common/Hosting/TestRunTimeProviderManager.cs b/src/Microsoft.TestPlatform.Common/Hosting/TestRunTimeProviderManager.cs index 0e9f670a5f..da1e3b30c9 100644 --- a/src/Microsoft.TestPlatform.Common/Hosting/TestRunTimeProviderManager.cs +++ b/src/Microsoft.TestPlatform.Common/Hosting/TestRunTimeProviderManager.cs @@ -25,7 +25,7 @@ public class TestRuntimeProviderManager #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Default constructor. /// /// diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IParallelProxyDiscoveryManager.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IParallelProxyDiscoveryManager.cs index 40f1d9e360..908b744543 100644 --- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IParallelProxyDiscoveryManager.cs +++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IParallelProxyDiscoveryManager.cs @@ -21,8 +21,8 @@ public interface IParallelProxyDiscoveryManager : IParallelOperationManager, IPr /// True if parallel discovery is complete bool HandlePartialDiscoveryComplete( IProxyDiscoveryManager proxyDiscoveryManager, - long totalTests, - IEnumerable lastChunk, + long totalTests, + IEnumerable lastChunk, bool isAborted); } } diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IProxyExecutionManager.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IProxyExecutionManager.cs index 4d69ab173b..1e696eef6f 100644 --- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IProxyExecutionManager.cs +++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IProxyExecutionManager.cs @@ -32,13 +32,13 @@ public interface IProxyExecutionManager /// /// Cancels the test run. On the test host, this will send a message to adapters. /// - // EventHandler for handling execution events from Engine. + // EventHandler for handling execution events from Engine. void Cancel(ITestRunEventsHandler eventHandler); /// /// Aborts the test operation. This will forcefully terminate the test host. /// - // EventHandler for handling execution events from Engine. + // EventHandler for handling execution events from Engine. void Abort(ITestRunEventsHandler eventHandler); /// diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/TestExecutionContext.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/TestExecutionContext.cs index 9e0c19c240..8f0ebb0267 100644 --- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/TestExecutionContext.cs +++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/TestExecutionContext.cs @@ -55,7 +55,7 @@ public TestExecutionContext( this.KeepAlive = keepAlive; this.IsDataCollectionEnabled = isDataCollectionEnabled; this.AreTestCaseLevelEventsRequired = areTestCaseLevelEventsRequired; - + this.IsDebug = isDebug; this.HasTestRun = hasTestRun; @@ -170,7 +170,7 @@ public bool HasTestRun } /// - /// Gets or sets a configuration associated with this run. + /// Gets or sets a configuration associated with this run. /// /// It is not serialized over wcf as the information is available in the run settings [IgnoreDataMember] diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ITestCaseEventsHandler.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ITestCaseEventsHandler.cs index 4e27cc48bf..178dbb2912 100644 --- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ITestCaseEventsHandler.cs +++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ITestCaseEventsHandler.cs @@ -23,7 +23,7 @@ public interface ITestCaseEventsHandler /// Details of the test case. /// Result of the test case executed. void SendTestCaseEnd(TestCase testCase, TestOutcome outcome); - + /// /// Sends the test result /// diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/ITestRunEventsRegistrar.cs b/src/Microsoft.TestPlatform.Common/Interfaces/ITestRunEventsRegistrar.cs index f47df5ba9a..23cdbc0fb8 100644 --- a/src/Microsoft.TestPlatform.Common/Interfaces/ITestRunEventsRegistrar.cs +++ b/src/Microsoft.TestPlatform.Common/Interfaces/ITestRunEventsRegistrar.cs @@ -15,7 +15,7 @@ public interface ITestRunEventsRegistrar : IBaseTestEventsRegistrar void RegisterTestRunEvents(ITestRunRequest testRunRequest); /// - /// Unregisters the events from the test run request. + /// Unregisters the events from the test run request. /// /// The run request from which events should be unregistered. void UnregisterTestRunEvents(ITestRunRequest testRunRequest); diff --git a/src/Microsoft.TestPlatform.Common/SettingsProvider/SettingsProviderExtensionManager.cs b/src/Microsoft.TestPlatform.Common/SettingsProvider/SettingsProviderExtensionManager.cs index d40575e0b5..7f7335a5ea 100644 --- a/src/Microsoft.TestPlatform.Common/SettingsProvider/SettingsProviderExtensionManager.cs +++ b/src/Microsoft.TestPlatform.Common/SettingsProvider/SettingsProviderExtensionManager.cs @@ -53,7 +53,7 @@ public class SettingsProviderExtensionManager /// /// The settings providers are imported as non-shared because we need different settings provider /// instances to be used for each run settings. - /// + /// [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] protected SettingsProviderExtensionManager( IEnumerable> settingsProviders, @@ -151,8 +151,8 @@ public static void LoadAndInitializeAllExtensions(bool shouldThrowOnError) { foreach (var settingsProvider in extensionManager.SettingsProvidersMap) { - // Note: - The below Verbose call should not be under IsVerboseEnabled check as we want to - // call executor.Value even if logging is not enabled. + // Note: - The below Verbose call should not be under IsVerboseEnabled check as we want to + // call executor.Value even if logging is not enabled. EqtTrace.Verbose("SettingsProviderExtensionManager: Loading settings provider {0}", settingsProvider.Value.Value); } } diff --git a/src/Microsoft.TestPlatform.Common/Telemetry/NoOpMetricsCollection.cs b/src/Microsoft.TestPlatform.Common/Telemetry/NoOpMetricsCollection.cs index 4f1956b546..adee1f4a25 100644 --- a/src/Microsoft.TestPlatform.Common/Telemetry/NoOpMetricsCollection.cs +++ b/src/Microsoft.TestPlatform.Common/Telemetry/NoOpMetricsCollection.cs @@ -8,7 +8,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.Telemetry using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; /// - /// If Telemtry is opted out, this class will be initialized and will do No operation. + /// If Telemetry is opted out, this class will be initialized and will do No operation. /// public class NoOpMetricsCollection : IMetricsCollection { diff --git a/src/Microsoft.TestPlatform.Common/Utilities/AssemblyProperties.cs b/src/Microsoft.TestPlatform.Common/Utilities/AssemblyProperties.cs index 20e2c6de4a..504776695b 100644 --- a/src/Microsoft.TestPlatform.Common/Utilities/AssemblyProperties.cs +++ b/src/Microsoft.TestPlatform.Common/Utilities/AssemblyProperties.cs @@ -11,7 +11,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.Utilities using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers; using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces; - + public class AssemblyProperties : IAssemblyProperties { private readonly IFileHelper fileHelper; diff --git a/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs b/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs index d07109a722..b772c39551 100644 --- a/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs +++ b/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs @@ -43,7 +43,7 @@ public static string GenerateFakesSettingsForRunConfiguration(string[] sources, { throw new ArgumentNullException(nameof(runSettingsXml)); } - + // do not generate fakes for netcore if (IsNetCoreFramework(runSettingsXml)) { diff --git a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs index e9408978fb..caee639e54 100644 --- a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs +++ b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs @@ -57,7 +57,7 @@ public static Framework GetTargetFramework(RunConfiguration runConfiguration) Framework targetFramework = null; if (runConfiguration != null) { - // It will get target framework from runsettings + // It will get target framework from runsettings targetFramework = runConfiguration.TargetFramework; } diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/EventHandlers/TestDiscoveryEventHandler.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/EventHandlers/TestDiscoveryEventHandler.cs index a757208fa9..bcc62695b2 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/EventHandlers/TestDiscoveryEventHandler.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/EventHandlers/TestDiscoveryEventHandler.cs @@ -38,7 +38,7 @@ public void HandleDiscoveredTests(IEnumerable discoveredTestCases) /// /// Handle discovery complete. /// - /// Discovery Compelete Events Args. + /// Discovery Complete Events Args. /// The last chunk. public void HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryCompleteEventArgs, IEnumerable lastChunk) { diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/Messages/MessageType.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/Messages/MessageType.cs index b7eb93ded8..eb489480be 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/Messages/MessageType.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/Messages/MessageType.cs @@ -176,7 +176,7 @@ public static class MessageType public const string AfterTestRunEnd = "DataCollection.AfterTestRunEnd"; /// - /// Event message type used by dastacollector to send result on receiving test run end event. + /// Event message type used by datacollector to send result on receiving test run end event. /// public const string AfterTestRunEndResult = "DataCollection.AfterTestRunEndResult"; diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/FrameworkHandle.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/FrameworkHandle.cs index 83cc38fcbb..8aaa8b03bf 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/FrameworkHandle.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/FrameworkHandle.cs @@ -22,13 +22,13 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Adapter internal class FrameworkHandle : TestExecutionRecorder, IFrameworkHandle, IDisposable { /// - /// boolean that gives the value of EnableShutdownAfterTestRun. + /// boolean that gives the value of EnableShutdownAfterTestRun. /// Default value is set to false in the constructor. /// private bool enableShutdownAfterTestRun; /// - /// Context in which the current run is executing. + /// Context in which the current run is executing. /// private TestExecutionContext testExecutionContext; @@ -49,7 +49,7 @@ internal class FrameworkHandle : TestExecutionRecorder, IFrameworkHandle, IDispo /// The test run cache. /// The test execution context. /// TestRun Events Handler - public FrameworkHandle(ITestCaseEventsHandler testCaseEventsHandler, ITestRunCache testRunCache, + public FrameworkHandle(ITestCaseEventsHandler testCaseEventsHandler, ITestRunCache testRunCache, TestExecutionContext testExecutionContext, ITestRunEventsHandler testRunEventsHandler) : base(testCaseEventsHandler, testRunCache) { @@ -59,9 +59,9 @@ public FrameworkHandle(ITestCaseEventsHandler testCaseEventsHandler, ITestRunCac /// - /// Give a hint to the execution framework to enable the shutdown of execution process after the test run is complete. This should be used only in out of process test runs when IRunContext.KeepAlive is true - /// and should be used only when absolutely required as using it degrades the performance of the subsequent run. - /// It throws InvalidOperationException when it is attempted to be enabled when keepAlive is false. + /// Give a hint to the execution framework to enable the shutdown of execution process after the test run is complete. This should be used only in out of process test runs when IRunContext.KeepAlive is true + /// and should be used only when absolutely required as using it degrades the performance of the subsequent run. + /// It throws InvalidOperationException when it is attempted to be enabled when keepAlive is false. /// public bool EnableShutdownAfterTestRun { @@ -122,7 +122,7 @@ public void Dispose() protected virtual void Dispose(bool disposing) { - // If you need thread safety, use a lock around these + // If you need thread safety, use a lock around these // operations, as well as in your methods that use the resource. if (!this.isDisposed) { diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/TestExecutionRecorder.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/TestExecutionRecorder.cs index 3973a69f26..b347b020a5 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/TestExecutionRecorder.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/TestExecutionRecorder.cs @@ -27,7 +27,7 @@ internal class TestExecutionRecorder : TestSessionMessageLogger, ITestExecutionR /// Start has been recorded but End has not yet been recorded. /// private HashSet testCaseInProgressMap; - + private object testCaseInProgressSyncObject = new object(); /// @@ -62,8 +62,8 @@ internal Collection Attachments } /// - /// Notify the framework about starting of the test case. - /// Framework sends this event to data collectors enabled in the run. If no data collector is enabled, then the event is ignored. + /// Notify the framework about starting of the test case. + /// Framework sends this event to data collectors enabled in the run. If no data collector is enabled, then the event is ignored. /// /// test case which will be started. public void RecordStart(TestCase testCase) @@ -89,8 +89,8 @@ public void RecordStart(TestCase testCase) /// Notify the framework about the test result. /// /// Test Result to be sent to the framework. - /// Exception thrown by the framework when an executor attempts to send - /// test result to the framework when the test(s) is canceled. + /// Exception thrown by the framework when an executor attempts to send + /// test result to the framework when the test(s) is canceled. public void RecordResult(TestResult testResult) { EqtTrace.Verbose("TestExecutionRecorder.RecordResult: Received result for test: {0}.", testResult?.TestCase?.FullyQualifiedName); @@ -106,7 +106,7 @@ public void RecordResult(TestResult testResult) } /// - /// Notify the framework about completion of the test case. + /// Notify the framework about completion of the test case. /// Framework sends this event to data collectors enabled in the run. If no data collector is enabled, then the event is ignored. /// /// test case which has completed. diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryDataAggregator.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryDataAggregator.cs index 6767b5bfa9..c85cc9d000 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryDataAggregator.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryDataAggregator.cs @@ -75,7 +75,7 @@ public IDictionary GetAggregatedDiscoveryDataMetrics() } /// - /// Aggregate discovery data + /// Aggregate discovery data /// Must be thread-safe as this is expected to be called by parallel managers /// public void Aggregate(long totalTests, bool isAborted) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs index 89b22bc3dd..93d1115754 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelDiscoveryEventsHandler.cs @@ -63,14 +63,14 @@ public void HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryComplete // we get discovery complete events from each host process // so we cannot "complete" the actual operation until all sources are consumed - // We should not block last chunk results while we aggregate overall discovery data + // We should not block last chunk results while we aggregate overall discovery data if (lastChunk != null) { ConvertToRawMessageAndSend(MessageType.TestCasesFound, lastChunk); this.HandleDiscoveredTests(lastChunk); } - // Aggregate for final discoverycomplete + // Aggregate for final discovery complete discoveryDataAggregator.Aggregate(totalTests, isAborted); // Aggregate Discovery Data Metrics @@ -87,7 +87,7 @@ public void HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryComplete if (parallelDiscoveryComplete) { // In case of sequential discovery - RawMessage would have contained a 'DiscoveryCompletePayload' object - // To send a raw message - we need to create raw message from an aggregated payload object + // To send a raw message - we need to create raw message from an aggregated payload object var testDiscoveryCompletePayload = new DiscoveryCompletePayload() { TotalTests = discoveryDataAggregator.TotalTests, @@ -102,14 +102,14 @@ public void HandleDiscoveryComplete(DiscoveryCompleteEventArgs discoveryComplete var aggregatedDiscoveryDataMetrics = discoveryDataAggregator.GetAggregatedDiscoveryDataMetrics(); testDiscoveryCompletePayload.Metrics = aggregatedDiscoveryDataMetrics; - // we have to send raw messages as we block the discoverycomplete actual raw messages + // we have to send raw messages as we block the discovery complete actual raw messages this.ConvertToRawMessageAndSend(MessageType.DiscoveryComplete, testDiscoveryCompletePayload); var finalDiscoveryCompleteEventArgs = new DiscoveryCompleteEventArgs(this.discoveryDataAggregator.TotalTests, this.discoveryDataAggregator.IsAborted); finalDiscoveryCompleteEventArgs.Metrics = aggregatedDiscoveryDataMetrics; - // send actual test discoverycomplete to clients + // send actual test discovery complete to clients this.actualDiscoveryEventsHandler.HandleDiscoveryComplete(finalDiscoveryCompleteEventArgs, null); } } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs index fbd8a7b9f5..323847a815 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs @@ -232,11 +232,11 @@ private void DoManagerAction(Action action) } } } - + /// /// Fetches the next data object for the concurrent executor to work on /// - /// sourcedata to work on - sourcefile or testCaseList + /// source data to work on - source file or testCaseList /// True, if data exists. False otherwise protected bool TryFetchNextSource(IEnumerator enumerator, out Y source) { diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs index 361e79758e..ec6a96acfb 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyDiscoveryManager.cs @@ -31,7 +31,7 @@ internal class ParallelProxyDiscoveryManager : ParallelOperationManager sourceEnumerator; - + private ITestDiscoveryEventsHandler2 currentDiscoveryEventsHandler; private ParallelDiscoveryDataAggregator currentDiscoveryDataAggregator; @@ -108,8 +108,8 @@ public bool HandlePartialDiscoveryComplete(IProxyDiscoveryManager proxyDiscovery var allDiscoverersCompleted = false; lock (this.discoveryStatusLockObject) { - // Each concurrent Executor calls this method - // So, we need to keep track of total discoverycomplete calls + // Each concurrent Executor calls this method + // So, we need to keep track of total discovery complete calls this.discoveryCompletedClients++; // If there are no more sources/testcases, a parallel executor is truly done with discovery @@ -170,7 +170,7 @@ private void DiscoverTestsPrivate(ITestDiscoveryEventsHandler2 discoveryEventsHa { this.currentDiscoveryEventsHandler = discoveryEventsHandler; - // Reset the discoverycomplete data + // Reset the discovery complete data this.discoveryCompletedClients = 0; // One data aggregator per parallel discovery diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs index 3dc43912ae..3e0e0da772 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelProxyExecutionManager.cs @@ -62,7 +62,6 @@ internal class ParallelProxyExecutionManager : ParallelOperationManager private readonly object executionStatusLockObject = new object(); - #endregion @@ -110,7 +109,7 @@ public int StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler e testCasesBySource[test.Source].Add(test); } - // Do not use "Dictionary.ValueCollection.Enumerator" - it becomes undetermenstic once we go out of scope of this method + // Do not use "Dictionary.ValueCollection.Enumerator" - it becomes nondeterministic once we go out of scope of this method // Use "ToArray" to copy ValueColleciton to a simple array and use it's enumerator // Set the enumerator for parallel yielding of testCases // Whenever a concurrent executor becomes free, it picks up the next set of testCases using this enumerator @@ -175,7 +174,7 @@ public bool HandlePartialRunComplete( lock (this.executionStatusLockObject) { // Each concurrent Executor calls this method - // So, we need to keep track of total runcomplete calls + // So, we need to keep track of total run complete calls this.runCompletedClients++; if (testRunCompleteArgs.IsCanceled || abortRequested) @@ -204,9 +203,9 @@ public bool HandlePartialRunComplete( this.currentRunEventsHandler = null; // Dispose concurrent executors - // Do not do the cleanuptask in the current thread as we will unnecessarily add to execution time + // Do not do the cleanup task in the current thread as we will unnecessarily add to execution time this.UpdateParallelLevel(0); - + return true; } @@ -237,7 +236,7 @@ private int StartTestRunPrivate(ITestRunEventsHandler runEventsHandler) { this.currentRunEventsHandler = runEventsHandler; - // Reset the runcomplete data + // Reset the run complete data this.runCompletedClients = 0; // One data aggregator per parallel run diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelRunDataAggregator.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelRunDataAggregator.cs index 143cfe0dd6..2cc3d3c26c 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelRunDataAggregator.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelRunDataAggregator.cs @@ -126,7 +126,7 @@ public Exception GetAggregatedException() } /// - /// Aggregate Run Data + /// Aggregate Run Data /// Must be thread-safe as this is expected to be called by parallel managers /// public void Aggregate( diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelRunEventsHandler.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelRunEventsHandler.cs index f9d27eb619..4342b9708d 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelRunEventsHandler.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelRunEventsHandler.cs @@ -36,7 +36,7 @@ public ParallelRunEventsHandler(IRequestData requestData, IProxyExecutionManager proxyExecutionManager, ITestRunEventsHandler actualRunEventsHandler, IParallelProxyExecutionManager parallelProxyExecutionManager, - ParallelRunDataAggregator runDataAggregator) : + ParallelRunDataAggregator runDataAggregator) : this(requestData, proxyExecutionManager, actualRunEventsHandler, parallelProxyExecutionManager, runDataAggregator, JsonDataSerializer.Instance) { } @@ -95,15 +95,15 @@ protected bool HandleSingleTestRunComplete(TestRunCompleteEventArgs testRunCompl { // we get run complete events from each executor process // so we cannot "complete" the actual executor operation until all sources/testcases are consumed - // We should not block last chunk results while we aggregate overall run data + // We should not block last chunk results while we aggregate overall run data if (lastChunkArgs != null) { ConvertToRawMessageAndSend(MessageType.TestRunStatsChange, lastChunkArgs); HandleTestRunStatsChange(lastChunkArgs); } - // Update runstats, executorUris, etc. - // we need this data when we send the final runcomplete + // Update run stats, executorUris, etc. + // we need this data when we send the final run complete this.runDataAggregator.Aggregate( testRunCompleteArgs.TestRunStatistics, executorUris, @@ -128,7 +128,7 @@ protected bool HandleSingleTestRunComplete(TestRunCompleteEventArgs testRunCompl protected void HandleParallelTestRunComplete(TestRunCompleteEventArgs completedArgs) { // In case of sequential execution - RawMessage would have contained a 'TestRunCompletePayload' object - // To send a rawmessge - we need to create rawmessage from an aggregated payload object + // To send a rawmessge - we need to create rawmessage from an aggregated payload object var testRunCompletePayload = new TestRunCompletePayload() { ExecutorUris = this.runDataAggregator.ExecutorUris, @@ -137,10 +137,10 @@ protected void HandleParallelTestRunComplete(TestRunCompleteEventArgs completedA TestRunCompleteArgs = completedArgs }; - // we have to send rawmessages as we block the runcomplete actual raw messages + // we have to send rawmessages as we block the run complete actual raw messages ConvertToRawMessageAndSend(MessageType.ExecutionComplete, testRunCompletePayload); - // send actual test runcomplete to clients + // send actual test run complete to clients this.actualRunEventsHandler.HandleTestRunComplete( completedArgs, null, this.runDataAggregator.RunContextAttachments, this.runDataAggregator.ExecutorUris); } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManager.cs index 800edb78ea..dff1853037 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManager.cs @@ -43,7 +43,7 @@ internal class ProxyExecutionManager : ProxyOperationManager, IProxyExecutionMan #region Constructors /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The Request Data for providing services and data for Run. /// Test request sender instance. @@ -54,7 +54,7 @@ public ProxyExecutionManager(IRequestData requestData, ITestRequestSender reques } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Constructor with Dependency injection. Used for unit testing. /// /// The Request Data for Common services and data for Run. diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManagerWithDataCollection.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManagerWithDataCollection.cs index 7547ecda51..6aa6684e2d 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManagerWithDataCollection.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManagerWithDataCollection.cs @@ -24,7 +24,7 @@ internal class ProxyExecutionManagerWithDataCollection : ProxyExecutionManager private IRequestData requestData; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Test request sender instance. @@ -184,7 +184,7 @@ protected override TestProcessStartInfo UpdateTestProcessStartInfo(TestProcessSt internal class DataCollectionRunEventsHandler : ITestMessageEventHandler { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public DataCollectionRunEventsHandler() { diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs index fba4cb72e5..21054fdb31 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs @@ -49,7 +49,7 @@ public abstract class ProxyOperationManager #region Constructors /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Request Sender instance. @@ -150,7 +150,7 @@ public virtual bool SetupChannel(IEnumerable sources, string runSettings var nativeHostDebugEnabled = Environment.GetEnvironmentVariable("VSTEST_HOST_NATIVE_DEBUG"); if (!string.IsNullOrEmpty(hostDebugEnabled) && hostDebugEnabled.Equals("1", StringComparison.Ordinal) || - new PlatformEnvironment().OperatingSystem.Equals(PlatformOperatingSystem.Windows) && + new PlatformEnvironment().OperatingSystem.Equals(PlatformOperatingSystem.Windows) && !string.IsNullOrEmpty(nativeHostDebugEnabled) && nativeHostDebugEnabled.Equals("1", StringComparison.Ordinal)) { ConsoleOutput.Instance.WriteLine(CrossPlatEngineResources.HostDebuggerWarning, OutputLevel.Warning); @@ -224,7 +224,7 @@ public virtual void Close() EqtTrace.Warning("ProxyOperationManager: Timed out waiting for test host to exit. Will terminate process."); - // please clean up test host. + // please clean up test host. this.testHostManager.CleanTestHostAsync(CancellationToken.None).Wait(); this.testHostManager.HostExited -= this.TestHostManagerHostExited; @@ -235,11 +235,11 @@ public virtual void Close() #endregion /// - /// This method is exposed to enable derived classes to modify TestProcessStartInfo. E.g. DataCollection need additional environment variables to be passed, etc. + /// This method is exposed to enable derived classes to modify TestProcessStartInfo. E.g. DataCollection need additional environment variables to be passed, etc. /// /// /// The sources. - /// + /// /// /// The . /// diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestRunCriteriaExtensions.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestRunCriteriaExtensions.cs index f7dc6ad70a..a314ec338c 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestRunCriteriaExtensions.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestRunCriteriaExtensions.cs @@ -13,7 +13,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client internal static class TestRunCriteriaExtensions { - public static TestRunCriteriaWithSources CreateTestRunCriteriaForSources(this TestRunCriteria testRunCriteria, ITestRuntimeProvider testRuntimeProvider, + public static TestRunCriteriaWithSources CreateTestRunCriteriaForSources(this TestRunCriteria testRunCriteria, ITestRuntimeProvider testRuntimeProvider, string runSettings, TestExecutionContext executionContext, IEnumerable inputPackages) { if (TryCheckTestSourceDifferFromPackage(testRuntimeProvider, inputPackages, out IEnumerable actualTestSources)) @@ -28,12 +28,12 @@ public static TestRunCriteriaWithSources CreateTestRunCriteriaForSources(this Te return new TestRunCriteriaWithSources(testRunCriteria.AdapterSourceMap, inputPackages?.FirstOrDefault(), runSettings, executionContext); } - public static TestRunCriteriaWithTests CreateTestRunCriteriaForTests(this TestRunCriteria testRunCriteria, ITestRuntimeProvider testRuntimeProvider, + public static TestRunCriteriaWithTests CreateTestRunCriteriaForTests(this TestRunCriteria testRunCriteria, ITestRuntimeProvider testRuntimeProvider, string runSettings, TestExecutionContext executionContext, IEnumerable inputPackages) { if (TryCheckTestSourceDifferFromPackage(testRuntimeProvider, inputPackages, out IEnumerable actualTestSources)) { - // In UWP scenario TestCase object contains the package as source, which is not actual test source for adapters, + // In UWP scenario TestCase object contains the package as source, which is not actual test source for adapters, // so update test case before sending them. // We are limiting that a testhost will always run for a single package, A package can contain multiple sources foreach (var tc in testRunCriteria.Tests) @@ -49,13 +49,13 @@ public static TestRunCriteriaWithTests CreateTestRunCriteriaForTests(this TestRu return new TestRunCriteriaWithTests(testRunCriteria.Tests, inputPackages?.FirstOrDefault(), runSettings, executionContext); } - private static bool TryCheckTestSourceDifferFromPackage(ITestRuntimeProvider testRuntimeProvider, + private static bool TryCheckTestSourceDifferFromPackage(ITestRuntimeProvider testRuntimeProvider, IEnumerable inputPackages, out IEnumerable actualTestSources) { actualTestSources = testRuntimeProvider.GetTestSources(inputPackages); - // For netcore/fullclr both packages and sources are same thing, + // For netcore/fullclr both packages and sources are same thing, // For UWP the actual source(exe) differs from input source(.appxrecipe) which we call package. // So in such models we check if they differ, then we pass this info to test host to update TestCase source with package info, // since this is needed by IDE's to map a TestCase to project. diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs index 6c04ed01dc..0af3ecd996 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DataCollectionTestRunEventsHandler.cs @@ -18,8 +18,8 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.DataCollection using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; /// - /// Handles DataCollection attachments by calling DataCollection Process on Test Run Complete. - /// Existing functionality of ITestRunEventsHandler is decorated with aditional call to Data Collection Process. + /// Handles DataCollection attachments by calling DataCollection Process on Test Run Complete. + /// Existing functionality of ITestRunEventsHandler is decorated with additional call to Data Collection Process. /// internal class DataCollectionTestRunEventsHandler : ITestRunEventsHandler { diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DefaultDataCollectionLauncher.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DefaultDataCollectionLauncher.cs index da6d357f4e..3ce2560159 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DefaultDataCollectionLauncher.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DefaultDataCollectionLauncher.cs @@ -30,10 +30,10 @@ public DefaultDataCollectionLauncher() } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - /// The process helper. + /// The process helper. /// /// /// The message Logger. diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DotnetDataCollectionLauncher.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DotnetDataCollectionLauncher.cs index ca635679c4..07ea260cd8 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DotnetDataCollectionLauncher.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DotnetDataCollectionLauncher.cs @@ -27,7 +27,7 @@ internal class DotnetDataCollectionLauncher : DataCollectionLauncher private IFileHelper fileHelper; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public DotnetDataCollectionLauncher() : this(new ProcessHelper(), new FileHelper(), TestSessionMessageLogger.Instance) @@ -38,7 +38,7 @@ public DotnetDataCollectionLauncher() /// Initializes a new instance of the class. /// /// - /// The process helper. + /// The process helper. /// /// /// The file Helper. @@ -76,7 +76,7 @@ public override int LaunchDataCollector(IDictionary environmentV var args = "exec"; - // Probe for runtimeconfig and deps file for the test source + // Probe for runtime config and deps file for the test source var runtimeConfigPath = Path.Combine(dataCollectorDirectory, string.Concat(dataCollectorFileName, ".runtimeconfig.json")); if (this.fileHelper.Exists(runtimeConfigPath)) @@ -92,7 +92,7 @@ public override int LaunchDataCollector(IDictionary environmentV { if (EqtTrace.IsVerboseEnabled) { - EqtTrace.Verbose("DotnetDataCollectionLauncher: File {0}, doesnot exist", runtimeConfigPath); + EqtTrace.Verbose("DotnetDataCollectionLauncher: File {0}, does not exist", runtimeConfigPath); } } @@ -111,7 +111,7 @@ public override int LaunchDataCollector(IDictionary environmentV { if (EqtTrace.IsVerboseEnabled) { - EqtTrace.Verbose("DotnetDataCollectionLauncher: File {0}, doesnot exist", depsFilePath); + EqtTrace.Verbose("DotnetDataCollectionLauncher: File {0}, does not exist", depsFilePath); } } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs index bb35cc9cb7..3c8abb8da9 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs @@ -27,7 +27,7 @@ internal class InProcDataCollector : IInProcDataCollector private Type dataCollectorType; /// - /// Instance of the + /// Instance of the /// private object dataCollectorObject; @@ -96,7 +96,7 @@ internal InProcDataCollector(string codeBase, string assemblyQualifiedName, Type public string AssemblyQualifiedName { get; private set; } /// - /// Loads the DataCollector type + /// Loads the DataCollector type /// /// Sink object to send data public void LoadDataCollector(IDataCollectionSink inProcDataCollectionSink) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/Interfaces/IInProcDataCollector.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/Interfaces/IInProcDataCollector.cs index 896baf2cfb..57980ff3b4 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/Interfaces/IInProcDataCollector.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/Interfaces/IInProcDataCollector.cs @@ -18,7 +18,7 @@ internal interface IInProcDataCollector string AssemblyQualifiedName { get; } /// - /// Loads the DataCollector type + /// Loads the DataCollector type /// /// Sink object to send data void LoadDataCollector(IDataCollectionSink inProcDataCollectionSink); diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ParallelDataCollectionEventsHandler.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ParallelDataCollectionEventsHandler.cs index 3a3a1ed7d5..0f5432cd78 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ParallelDataCollectionEventsHandler.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ParallelDataCollectionEventsHandler.cs @@ -21,10 +21,10 @@ internal class ParallelDataCollectionEventsHandler : ParallelRunEventsHandler private readonly ParallelRunDataAggregator runDataAggregator; public ParallelDataCollectionEventsHandler(IRequestData requestData, - IProxyExecutionManager proxyExecutionManager, - ITestRunEventsHandler actualRunEventsHandler, - IParallelProxyExecutionManager parallelProxyExecutionManager, - ParallelRunDataAggregator runDataAggregator) : + IProxyExecutionManager proxyExecutionManager, + ITestRunEventsHandler actualRunEventsHandler, + IParallelProxyExecutionManager parallelProxyExecutionManager, + ParallelRunDataAggregator runDataAggregator) : this(requestData, proxyExecutionManager, actualRunEventsHandler, parallelProxyExecutionManager, runDataAggregator, JsonDataSerializer.Instance) { } @@ -34,7 +34,7 @@ internal ParallelDataCollectionEventsHandler(IRequestData requestData, ITestRunEventsHandler actualRunEventsHandler, IParallelProxyExecutionManager parallelProxyExecutionManager, ParallelRunDataAggregator runDataAggregator, - IDataSerializer dataSerializer) : + IDataSerializer dataSerializer) : base(requestData, proxyExecutionManager, actualRunEventsHandler, parallelProxyExecutionManager, runDataAggregator, dataSerializer) { this.runDataAggregator = runDataAggregator; @@ -50,7 +50,7 @@ public override void HandleTestRunComplete( ICollection executorUris) { var parallelRunComplete = HandleSingleTestRunComplete(testRunCompleteArgs, lastChunkArgs, runContextAttachments, executorUris); - + if (parallelRunComplete) { // TODO : use TestPluginCache to iterate over all IDataCollectorAttachments diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyDataCollectionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyDataCollectionManager.cs index e7d1fce7c3..282ceb5bf5 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyDataCollectionManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyDataCollectionManager.cs @@ -185,7 +185,7 @@ public DataCollectionParameters BeforeTestRunStart( this.InvokeDataCollectionServiceAction( () => { - EqtTrace.Info("ProxyDataCollectionManager.BeforeTestRunStart: Get env variable and port for datacollector processId: {0} port: {1}", this.dataCollectionProcessId, this.dataCollectionPort); + EqtTrace.Info("ProxyDataCollectionManager.BeforeTestRunStart: Get environment variable and port for datacollector processId: {0} port: {1}", this.dataCollectionProcessId, this.dataCollectionPort); var result = this.dataCollectionRequestSender.SendBeforeTestRunStartAndGetResult(this.SettingsXml, this.Sources, runEventsHandler); environmentVariables = result.EnvironmentVariables; dataCollectionEventsPort = result.DataCollectionEventsPort; diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryContext.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryContext.cs index cc3f377090..4f6e53d421 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryContext.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryContext.cs @@ -15,7 +15,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Discovery using CrossPlatEngineResources = Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Resources.Resources; /// - /// Specifies the user specified RunSettings and framework provided context of the discovery. + /// Specifies the user specified RunSettings and framework provided context of the discovery. /// public class DiscoveryContext : IDiscoveryContext { diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryManager.cs index a266585f5f..b7ac09572b 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryManager.cs @@ -76,7 +76,6 @@ public void Initialize(IEnumerable pathToAdditionalExtensions, ITestDisc // Load and Initialize extensions. TestDiscoveryExtensionManager.LoadAndInitializeAllExtensions(false); this.testPlatformEventSource.AdapterSearchStop(); - } /// @@ -98,7 +97,7 @@ public void DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEve this.testDiscoveryEventsHandler = eventHandler; var verifiedExtensionSourceMap = new Dictionary>(); - // Validate the sources + // Validate the sources foreach (var kvp in discoveryCriteria.AdapterSourceMap) { var verifiedSources = GetValidSources(kvp.Value, this.sessionMessageLogger); @@ -108,7 +107,7 @@ public void DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEve } } - + // If there are sources to discover if (verifiedExtensionSourceMap.Any()) { @@ -216,7 +215,7 @@ internal static IEnumerable GetValidSources(IEnumerable sources, } } - // No valid source is found => we cannot discover. + // No valid source is found => we cannot discover. if (!verifiedSources.Any()) { var sourcesString = string.Join(",", sources.ToArray()); diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryResultCache.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryResultCache.cs index f597a159e0..416bfd7d24 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryResultCache.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryResultCache.cs @@ -16,9 +16,9 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Discovery internal class DiscoveryResultCache { #region private members - + /// - /// Callback used when cache is full. + /// Callback used when cache is full. /// private OnReportTestCases onReportTestCases; @@ -48,7 +48,7 @@ internal class DiscoveryResultCache private List tests; /// - /// Sync object + /// Sync object /// private object syncObject = new object(); @@ -74,12 +74,12 @@ public DiscoveryResultCache(long cacheSize, TimeSpan discoveredTestEventTimeout, this.tests = new List(); this.totalDiscoveredTests = 0; } - + /// /// Called when the cache is ready to report some discovered test cases. /// public delegate void OnReportTestCases(ICollection tests); - + /// /// Gets the tests present in the cache currently /// @@ -122,7 +122,7 @@ public void AddTest(TestCase test) this.tests.Add(test); this.totalDiscoveredTests++; - // Send test cases when the specified cache size has been reached or + // Send test cases when the specified cache size has been reached or // after the specified cache timeout has been hit. var timeDelta = DateTime.Now - this.lastUpdate; if (this.tests.Count >= this.cacheSize || (timeDelta > this.cacheTimeout && this.tests.Count > 0)) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs index 07f2b18221..ae85f23f1e 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/ExecutionManager.cs @@ -76,7 +76,7 @@ public void Initialize(IEnumerable pathToAdditionalExtensions, ITestMess //unsubscrive session logger this.sessionMessageLogger.TestRunMessage -= this.TestSessionMessageHandler; - this.testPlatformEventSource.AdapterSearchStop(); + this.testPlatformEventSource.AdapterSearchStop(); } /// @@ -139,7 +139,6 @@ public void StartTestRun( this.activeTestRun = new RunTestsWithTests(this.requestData, tests, package, runSettings, testExecutionContext, testCaseEventsHandler, runEventsHandler); this.activeTestRun.RunTests(); - } catch (Exception e) { @@ -225,7 +224,7 @@ private void InitializeDataCollectors(string runSettings, ITestEventsPublisher t var outOfProcDataCollectionManager = new ProxyOutOfProcDataCollectionManager(DataCollectionTestCaseEventSender.Instance, testEventsPublisher); } - // Initialize inproc data collectors if declared in run settings. + // Initialize in-proc data collectors if declared in run settings. if (XmlRunSettingsUtilities.IsInProcDataCollectionEnabled(runSettings)) { var inProcDataCollectionExtensionManager = new InProcDataCollectionExtensionManager(runSettings, testEventsPublisher, defaultCodeBase, TestPluginCache.Instance); diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs index aca4e83318..a1fdb02873 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs @@ -61,7 +61,7 @@ internal RunTestsWithSources(IRequestData requestData, Dictionary 0 && !this.IsCancellationRequested && this.TestRunCache?.TotalExecutedTests <= 0) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/TestRunCache.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/TestRunCache.cs index 02c177f175..0782588d7d 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/TestRunCache.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/TestRunCache.cs @@ -12,16 +12,16 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution using Microsoft.VisualStudio.TestPlatform.ObjectModel; using ObjectModel.Client; - + /// /// Maintains a cache of last 'n' test results and maintains stats for the complete run. /// internal class TestRunCache : ITestRunCache { - #region Private members + #region Private Members /// - /// Specifies whether the object is disposed or not. + /// Specifies whether the object is disposed or not. /// private bool isDisposed; @@ -36,7 +36,7 @@ internal class TestRunCache : ITestRunCache private long totalExecutedTests; /// - /// Callback used when cache is ready to report some test results/case. + /// Callback used when cache is ready to report some test results/case. /// private OnCacheHit onCacheHit; @@ -71,7 +71,7 @@ internal class TestRunCache : ITestRunCache private ICollection testResults; /// - /// Sync object + /// Sync object /// private object syncObject; @@ -197,7 +197,7 @@ public void Dispose() } /// - /// Notifies the cache that a test is starting. + /// Notifies the cache that a test is starting. /// This notification comes from the adapter to the engine which then calls into the cache. /// /// The test Case. @@ -244,7 +244,7 @@ public void OnNewTestResult(TestResult testResult) /// Notifies the cache of a test completion. /// /// - /// The completed Test. + /// The completed Test. /// /// True if this test has been removed from the list of in progress tests. public bool OnTestCompletion(TestCase completedTest) @@ -306,7 +306,7 @@ public ICollection GetLastChunk() /// protected virtual void Dispose(bool disposing) { - // If you need thread safety, use a lock around these + // If you need thread safety, use a lock around these // operations, as well as in your methods that use the resource. if (disposing && !this.isDisposed) { @@ -332,7 +332,7 @@ private void CheckForCacheHit() { lock (this.syncObject) { - // Send results when the specified cache size has been reached or + // Send results when the specified cache size has been reached or // after the specified cache timeout has been hit. var timeDelta = DateTime.Now - this.lastUpdate; diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Interfaces/ITestRunCache.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Interfaces/ITestRunCache.cs index 84d6be65bd..41545dbc13 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Interfaces/ITestRunCache.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Interfaces/ITestRunCache.cs @@ -19,7 +19,6 @@ internal interface ITestRunCache : IDisposable ICollection TestResults { get; } ICollection InProgressTests { get; } - long TotalExecutedTests { get; } TestRunStatistics TestRunStatistics { get; } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs index b3e99e71ac..4beb28b714 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs @@ -166,7 +166,7 @@ public ITestLoggerManager GetLoggerManager(IRequestData requestData) { return new TestLoggerManager( requestData, - TestSessionMessageLogger.Instance, + TestSessionMessageLogger.Instance, new InternalTestLoggerEvents(TestSessionMessageLogger.Instance)); } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Utilities/TestSourcesUtility.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Utilities/TestSourcesUtility.cs index 52d6c337db..dd5ab82986 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Utilities/TestSourcesUtility.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Utilities/TestSourcesUtility.cs @@ -35,7 +35,7 @@ internal static IEnumerable GetSources(IEnumerable tests) } /// - /// Gets default code base path for inproc collector from test sources + /// Gets default code base path for in-proc collector from test sources /// /// The test list. /// List of test Sources @@ -46,7 +46,7 @@ internal static string GetDefaultCodebasePath(Dictionary - /// Gets default code base path for inproc collector from test sources + /// Gets default code base path for in-proc collector from test sources /// /// The test list. /// List of test Sources diff --git a/src/Microsoft.TestPlatform.Extensions.HtmlLogger/HtmlLogger.cs b/src/Microsoft.TestPlatform.Extensions.HtmlLogger/HtmlLogger.cs index 4523f7519e..9887a5b82c 100644 --- a/src/Microsoft.TestPlatform.Extensions.HtmlLogger/HtmlLogger.cs +++ b/src/Microsoft.TestPlatform.Extensions.HtmlLogger/HtmlLogger.cs @@ -61,7 +61,7 @@ public HtmlLogger(IFileHelper fileHelper, IHtmlTransformer htmlTransformer, public ConcurrentDictionary Results { get; private set; } /// - /// + /// /// public ConcurrentDictionary ResultCollectionDictionary { get; private set; } diff --git a/src/Microsoft.TestPlatform.Extensions.HtmlLogger/HtmlTransformer.cs b/src/Microsoft.TestPlatform.Extensions.HtmlLogger/HtmlTransformer.cs index 3eca547b4e..ffe5dd467e 100644 --- a/src/Microsoft.TestPlatform.Extensions.HtmlLogger/HtmlTransformer.cs +++ b/src/Microsoft.TestPlatform.Extensions.HtmlLogger/HtmlTransformer.cs @@ -9,7 +9,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger using System.Xml.Xsl; /// - /// Html transformer transforms the xml file to html file using xslt file. + /// Html transformer transforms the xml file to html file using xslt file. /// internal class HtmlTransformer : IHtmlTransformer { diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestExecId.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestExecId.cs index dcf48aa29b..11ed280e86 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestExecId.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestExecId.cs @@ -73,7 +73,7 @@ public override bool Equals(object obj) } /// - /// Override function of GetHashCode + /// Override function of GetHashCode /// /// /// The . diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs index 97b336b316..4ba33477af 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs @@ -7,10 +7,10 @@ namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel /// /// Outcome of a test or a run. - /// If a new successful state needs to be added you will need to modify + /// If a new successful state needs to be added you will need to modify /// RunResultAndStatistics in TestRun.cs and TestOutcomeHelper below. /// ---------------------------------------------------------------- - /// NOTE: the order is important and is used for computing outcome for aggregations. + /// NOTE: the order is important and is used for computing outcome for aggregations. /// More important outcomes come first. See TestOutcomeHelper.GetAggregationOutcome. /// internal enum TestOutcome @@ -32,7 +32,7 @@ internal enum TestOutcome Timeout, /// - /// Test was aborted. + /// Test was aborted. /// This was not caused by a user gesture, but rather by a framework decision. /// Aborted, @@ -54,7 +54,7 @@ internal enum TestOutcome NotRunnable, /// - /// Test was not executed. + /// Test was not executed. /// This was caused by a user gesture - e.g. user hit stop button. /// NotExecuted, diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs index 0bb0dddd23..6819883599 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs @@ -38,7 +38,7 @@ public class TrxLogger : ITestLoggerWithParameters #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public TrxLogger(): this (new Utilities.Helpers.FileHelper()) @@ -46,7 +46,7 @@ public TrxLogger(): } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Constructor with Dependency injection. Used for unit testing. /// /// The file helper interface. diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Collection.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Collection.cs index 6d50491458..49c6d41608 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Collection.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Collection.cs @@ -12,7 +12,7 @@ namespace Microsoft.TestPlatform.Extensions.TrxLogger.Utility using Microsoft.TestPlatform.Extensions.TrxLogger.XML; using Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel; /// - /// Base class for Eqt Collections. + /// Base class for Eqt Collections. /// Fast collection, default implementations (Add/Remove/etc) do not allow null items and ignore duplicates. /// internal class EqtBaseCollection : ICollection, IXmlTestStore @@ -59,7 +59,7 @@ public void Dispose() #endregion #region Fields - protected Hashtable container; + protected Hashtable container; private string childElementName; #endregion @@ -178,7 +178,7 @@ IEnumerator IEnumerable.GetEnumerator() #region IXmlTestStore Members /// - /// Default behavior is to create child elements with name same as name of type T. + /// Default behavior is to create child elements with name same as name of type T. /// Does not respect IXmlTestStoreCustom. /// public virtual void Save(System.Xml.XmlElement element, XmlTestStoreParameters parameters) diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Converter.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Converter.cs index 98a6b2a332..e67ca4fb9b 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Converter.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Utility/Converter.cs @@ -27,7 +27,7 @@ internal class Converter private IFileHelper fileHelper; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public Converter(IFileHelper fileHelper) { diff --git a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/IDiscoveryContext.cs b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/IDiscoveryContext.cs index fcd2a2aaab..c08b35be01 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/IDiscoveryContext.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/IDiscoveryContext.cs @@ -4,7 +4,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter { /// - /// Specifies the user specified RunSettings and framework provided context of the discovery. + /// Specifies the user specified RunSettings and framework provided context of the discovery. /// public interface IDiscoveryContext { diff --git a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/IFrameworkHandle.cs b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/IFrameworkHandle.cs index 2100683812..4e71e2e870 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/IFrameworkHandle.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/IFrameworkHandle.cs @@ -12,9 +12,9 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter public interface IFrameworkHandle : ITestExecutionRecorder, IMessageLogger { /// - /// Gets or sets a value indicating whether the execution framework enables the shutdown of execution process after the test run is complete. This should be used only in out of process test runs when IRunContext.KeepAlive is true - /// and should be used only when absolutely required as using it degrades the performance of the subsequent run. - /// It throws InvalidOperationException when it is attempted to be enabled when keepAlive is false. + /// Gets or sets a value indicating whether the execution framework enables the shutdown of execution process after the test run is complete. This should be used only in out of process test runs when IRunContext.KeepAlive is true + /// and should be used only when absolutely required as using it degrades the performance of the subsequent run. + /// It throws InvalidOperationException when it is attempted to be enabled when keepAlive is false. /// bool EnableShutdownAfterTestRun { get; set; } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/IRunContext.cs b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/IRunContext.cs index fb4b69b1aa..f80729e30c 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/IRunContext.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/IRunContext.cs @@ -7,7 +7,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter using System.Collections.Generic; /// - /// It provides user specified runSettings and framework provided context of the run. + /// It provides user specified runSettings and framework provided context of the run. /// public interface IRunContext : IDiscoveryContext { @@ -27,7 +27,7 @@ public interface IRunContext : IDiscoveryContext bool IsDataCollectionEnabled { get; } /// - /// Whether the test is being debugged or not. + /// Whether the test is being debugged or not. /// bool IsBeingDebugged { get; } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ISettingsProvider.cs b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ISettingsProvider.cs index 145fc166af..95549db334 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ISettingsProvider.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ISettingsProvider.cs @@ -6,7 +6,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter using System.Xml; /// - /// Interface implemented to provide a section in the run settings. A class that + /// Interface implemented to provide a section in the run settings. A class that /// implements this interface will be available for use if it exports its type via /// MEF, and if its containing assembly is placed in the Extensions folder. /// diff --git a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestCaseFilterExpression.cs b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestCaseFilterExpression.cs index 2b7b0a812f..fb9932fc71 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestCaseFilterExpression.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestCaseFilterExpression.cs @@ -6,7 +6,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter using System; /// - /// It represents expression for filtering test cases. + /// It represents expression for filtering test cases. /// public interface ITestCaseFilterExpression { diff --git a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestDiscoverer.cs b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestDiscoverer.cs index b1bb964ff2..aa8b710962 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestDiscoverer.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestDiscoverer.cs @@ -8,8 +8,8 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter /// /// Interface implemented to provide tests to the test platform. A class that - // implements this interface will be available for use if its containing - // assembly is either placed in the Extensions folder or is marked as a 'UnitTestExtension' type + // implements this interface will be available for use if its containing + // assembly is either placed in the Extensions folder or is marked as a 'UnitTestExtension' type // in the vsix package. /// public interface ITestDiscoverer diff --git a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestExecutor.cs b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestExecutor.cs index 8274768b0a..e77686a419 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestExecutor.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestExecutor.cs @@ -6,16 +6,16 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter using System.Collections.Generic; /// - /// Defines the test executor which provides capability to run tests. - /// - /// A class that implements this interface will be available for use if its containing - // assembly is either placed in the Extensions folder or is marked as a 'UnitTestExtension' type + /// Defines the test executor which provides capability to run tests. + /// + /// A class that implements this interface will be available for use if its containing + // assembly is either placed in the Extensions folder or is marked as a 'UnitTestExtension' type // in the vsix package. /// public interface ITestExecutor { /// - /// Runs only the tests specified by parameter 'tests'. + /// Runs only the tests specified by parameter 'tests'. /// /// Tests to be run. /// Context to use when executing the tests. @@ -23,7 +23,7 @@ public interface ITestExecutor void RunTests(IEnumerable tests, IRunContext runContext, IFrameworkHandle frameworkHandle); /// - /// Runs 'all' the tests present in the specified 'sources'. + /// Runs 'all' the tests present in the specified 'sources'. /// /// Path to test container files to look for tests in. /// Context to use when executing the tests. diff --git a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestLog.cs b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestLog.cs index e105dff998..01a61c541f 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestLog.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestLog.cs @@ -15,21 +15,21 @@ public interface ITestExecutionRecorder : IMessageLogger /// Notify the framework about the test result. /// /// Test Result to be sent to the framework. - /// Exception thrown by the framework when an executor attempts to send - /// test result to the framework when the test(s) is canceled. + /// Exception thrown by the framework when an executor attempts to send + /// test result to the framework when the test(s) is canceled. void RecordResult(TestResult testResult); /// - /// Notify the framework about starting of the test case. - /// Framework sends this event to data collectors enabled in the run. If no data collector is enabled, then the event is ignored. + /// Notify the framework about starting of the test case. + /// Framework sends this event to data collectors enabled in the run. If no data collector is enabled, then the event is ignored. /// /// testcase which will be started. void RecordStart(TestCase testCase); /// - /// Notify the framework about completion of the test case. - /// Framework sends this event to data collectors enabled in the run. If no data collector is enabled, then the event is ignored. + /// Notify the framework about completion of the test case. + /// Framework sends this event to data collectors enabled in the run. If no data collector is enabled, then the event is ignored. /// /// testcase which has completed. /// outcome of the test case. diff --git a/src/Microsoft.TestPlatform.ObjectModel/Adapter/TestsCanceledException.cs b/src/Microsoft.TestPlatform.ObjectModel/Adapter/TestsCanceledException.cs index 8f138573c9..090df725fe 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Adapter/TestsCanceledException.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Adapter/TestsCanceledException.cs @@ -10,8 +10,8 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter #endif /// - /// Exception thrown by the framework when an executor attempts to send - /// test result to the framework when the test is canceled. + /// Exception thrown by the framework when an executor attempts to send + /// test result to the framework when the test is canceled. /// #if NET451 [Serializable] diff --git a/src/Microsoft.TestPlatform.ObjectModel/AttachmentSet.cs b/src/Microsoft.TestPlatform.ObjectModel/AttachmentSet.cs index 0108cac3f2..3f2b043b90 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/AttachmentSet.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/AttachmentSet.cs @@ -8,27 +8,27 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel using System.Runtime.Serialization; /// - /// Represents a set of attachments. + /// Represents a set of attachments. /// [DataContract] public class AttachmentSet { /// - /// URI of the sender. - /// If a data-collector is sending this set, then it should be uri of the data collector. Also if an - /// executor is sending this attachment, then it should be uri of executor. + /// URI of the sender. + /// If a data-collector is sending this set, then it should be uri of the data collector. Also if an + /// executor is sending this attachment, then it should be uri of executor. /// [DataMember] public Uri Uri {get; private set;} /// - /// Name of the sender. + /// Name of the sender. /// [DataMember] public string DisplayName {get; private set;} /// - /// List of data attachments. + /// List of data attachments. /// These attachments can be things such as files that the collector/adapter wants to make available to the publishers. /// [DataMember] diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/DiscoveryCriteria.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/DiscoveryCriteria.cs index 03a35000b0..3d405314ac 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/DiscoveryCriteria.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/DiscoveryCriteria.cs @@ -43,7 +43,7 @@ public DiscoveryCriteria(IEnumerable sources, long frequencyOfDiscovered } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Sources from which the tests should be discovered diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Events/DiscoveryCompleteEventArgs.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Events/DiscoveryCompleteEventArgs.cs index d593b8fb5d..a17323a347 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/Events/DiscoveryCompleteEventArgs.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Events/DiscoveryCompleteEventArgs.cs @@ -13,7 +13,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Client public class DiscoveryCompleteEventArgs : EventArgs { /// - /// Constructor for creating event args object + /// Constructor for creating event args object /// /// Total tests which got discovered /// Specifies if discovery has been aborted. diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Events/TestRunCompleteEventArgs.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Events/TestRunCompleteEventArgs.cs index 85f87a48fa..8fb460ace3 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/Events/TestRunCompleteEventArgs.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Events/TestRunCompleteEventArgs.cs @@ -42,13 +42,13 @@ public TestRunCompleteEventArgs(ITestRunStatistics stats, bool isCanceled, bool public ITestRunStatistics TestRunStatistics { get; private set; } /// - /// Gets a value indicating whether the test run is canceled or not. + /// Gets a value indicating whether the test run is canceled or not. /// [DataMember] public bool IsCanceled { get; private set; } /// - /// Gets a value indicating whether the test run is aborted. + /// Gets a value indicating whether the test run is aborted. /// [DataMember] public bool IsAborted { get; private set; } @@ -58,9 +58,9 @@ public TestRunCompleteEventArgs(ITestRunStatistics stats, bool isCanceled, bool /// [DataMember] public Exception Error { get; private set; } - + /// - /// Gets the attachment sets associated with the test run. + /// Gets the attachment sets associated with the test run. /// [DataMember] public Collection AttachmentSets { get; private set; } @@ -77,5 +77,5 @@ public TestRunCompleteEventArgs(ITestRunStatistics stats, bool isCanceled, bool /// [DataMember] public IDictionary Metrics { get; set; } - } + } } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/FilterOptions.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/FilterOptions.cs index c0678b89ce..01c7e3bfea 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/FilterOptions.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/FilterOptions.cs @@ -7,22 +7,22 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Client using System.Runtime.Serialization; using System.Text; - ///   - /// Filter options to be passed into the Test Platform during Discovery/Execution.  - ///   + /// + /// Filter options to be passed into the Test Platform during Discovery/Execution. + /// [DataContract] public class FilterOptions { - ///   - /// Gets or sets the regular expression that will be applied on the property before matching.  - ///   + /// + /// Gets or sets the regular expression that will be applied on the property before matching. + /// [DataMember] public string FilterRegEx { get; set; } - ///   - /// Gets or sets the optional regular expression replacement string. When this property is set, - /// will be called upon property value instead of before matching.  - ///   + /// + /// Gets or sets the optional regular expression replacement string. When this property is set, + /// will be called upon property value instead of before matching. + /// [DataMember] public string FilterRegExReplacement { get; set; } @@ -32,15 +32,15 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.AppendLine(string.Format(CultureInfo.CurrentCulture, "FilterOptions:")); sb.AppendLine(string.Format(CultureInfo.CurrentCulture, - " FilterRegEx={0} FilterRegExReplacement={1}", + " FilterRegEx={0} FilterRegExReplacement={1}", this.FilterRegEx ?? string.Empty, this.FilterRegExReplacement ?? string.Empty)); return sb.ToString(); } - protected bool Equals(FilterOptions other) => - other != null && - string.Equals(this.FilterRegEx, other.FilterRegEx) && + protected bool Equals(FilterOptions other) => + other != null && + string.Equals(this.FilterRegEx, other.FilterRegEx) && string.Equals(this.FilterRegExReplacement, other.FilterRegExReplacement); /// diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IDiscoveryRequest.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IDiscoveryRequest.cs index 4cc0a6fd18..ce3ab28efc 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IDiscoveryRequest.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IDiscoveryRequest.cs @@ -7,7 +7,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Client using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; /// - /// IDiscoverTestsRequest returned after calling GetDiscoveredTestsAsync + /// IDiscoverTestsRequest returned after calling GetDiscoveredTestsAsync /// public interface IDiscoveryRequest : IRequest { @@ -27,7 +27,7 @@ public interface IDiscoveryRequest : IRequest event EventHandler OnDiscoveredTests; /// - /// Handler for receiving error during fetching/execution. This is used for when abnormal error + /// Handler for receiving error during fetching/execution. This is used for when abnormal error /// occurs; equivalent of IRunMessageLogger in the current RockSteady core /// event EventHandler OnDiscoveryMessage; diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IRequest.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IRequest.cs index f0e1a6215b..f9b8613e0b 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IRequest.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IRequest.cs @@ -14,7 +14,7 @@ public interface IRequest : IDisposable /// /// Handler for receiving raw messages directly from host without any deserialization or morphing /// This is required if one wants to re-direct the message over the process boundary without any processing overhead - /// All events should come as raw messages as well as actual serialized events + /// All events should come as raw messages as well as actual serialized events /// event EventHandler OnRawMessageReceived; diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestPlatform.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestPlatform.cs index eb55e5427f..9dbf71b13c 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestPlatform.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestPlatform.cs @@ -12,7 +12,7 @@ public interface ITestPlatform : IDisposable /// Update the extensions to be used by the test service /// /// - /// Specifies the path to unit test extensions. + /// Specifies the path to unit test extensions. /// If no additional extension is available, then specify null or empty list. /// /// diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestRunConfiguration.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestRunConfiguration.cs index 5254a3c229..cc81408b5b 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestRunConfiguration.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestRunConfiguration.cs @@ -11,24 +11,24 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Client public interface ITestRunConfiguration { /// - /// Defines the frequency of run stats test event. + /// Defines the frequency of run stats test event. /// /// - /// Run stats change event will be raised after completion of these number of tests. - /// - /// Note that this event is raised asynchronously and the underlying execution process is not - /// paused during the listener invocation. So if the event handler, you try to query the + /// Run stats change event will be raised after completion of these number of tests. + /// + /// Note that this event is raised asynchronously and the underlying execution process is not + /// paused during the listener invocation. So if the event handler, you try to query the /// next set of results, you may get more than 'FrequencyOfRunStatsChangeEvent'. - /// + /// long FrequencyOfRunStatsChangeEvent { get; } /// - /// Returns whether the run is configured to run specific tests + /// Returns whether the run is configured to run specific tests /// bool HasSpecificTests { get; } /// - /// Returns whether the run is configured to run specific sources + /// Returns whether the run is configured to run specific sources /// bool HasSpecificSources { get; } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestRunRequest.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestRunRequest.cs index 86bb3b02ef..43840f7f5d 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestRunRequest.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/ITestRunRequest.cs @@ -56,7 +56,7 @@ ITestRunConfiguration TestRunConfiguration event EventHandler OnRunCompletion; /// - /// Handler for receiving error during fetching/execution. This is used for when abnormal error + /// Handler for receiving error during fetching/execution. This is used for when abnormal error /// occurs; equivalent of IRunMessageLogger in the current RockSteady core /// event EventHandler TestRunMessage; diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/CustomHostLaunchAckPayload.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/CustomHostLaunchAckPayload.cs index cfa7e52ef1..60cae27735 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/CustomHostLaunchAckPayload.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/CustomHostLaunchAckPayload.cs @@ -11,13 +11,13 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Client public class CustomHostLaunchAckPayload { /// - /// ProcessId of the TestHost launched by Clients like IDE, LUT etc. + /// ProcessId of the TestHost launched by Clients like IDE, LUT etc. /// [DataMember] public int HostProcessId { get; set; } /// - /// ErrorMessage, in cases where custom launch fails + /// ErrorMessage, in cases where custom launch fails /// [DataMember] public string ErrorMessage { get; set; } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/DiscoveryRequestPayload.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/DiscoveryRequestPayload.cs index 810e3b382b..70f6a8a94a 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/DiscoveryRequestPayload.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/DiscoveryRequestPayload.cs @@ -12,13 +12,13 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Client public class DiscoveryRequestPayload { /// - /// Settings used for the discovery request. + /// Settings used for the discovery request. /// [DataMember] public IEnumerable Sources { get; set; } /// - /// Settings used for the discovery request. + /// Settings used for the discovery request. /// [DataMember] public string RunSettings { get; set; } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/TestRunRequestPayload.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/TestRunRequestPayload.cs index 8b61ef997b..95e208b38c 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/TestRunRequestPayload.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/TestRunRequestPayload.cs @@ -15,7 +15,7 @@ public class TestRunRequestPayload /// /// Gets or sets the sources for the test run request. /// - /// + /// /// Making this a list instead of an IEnumerable because the json serializer fails to deserialize /// if a linq query outputs the IEnumerable. /// @@ -25,7 +25,7 @@ public class TestRunRequestPayload /// /// Gets or sets the test cases for the test run request. /// - /// + /// /// Making this a list instead of an IEnumerable because the json serializer fails to deserialize /// if a linq query outputs the IEnumerable. /// @@ -33,19 +33,19 @@ public class TestRunRequestPayload public List TestCases { get; set; } /// - /// Gets or sets the settings used for the test run request. + /// Gets or sets the settings used for the test run request. /// [DataMember] public string RunSettings { get; set; } /// - /// Settings used for the Run request. + /// Settings used for the Run request. /// [DataMember] public bool KeepAlive { get; set; } /// - /// Is Debugging enabled + /// Is Debugging enabled /// [DataMember] public bool DebuggingEnabled { get; set; } diff --git a/src/Microsoft.TestPlatform.ObjectModel/CodeCoverage/TestSDKAutoGeneratedCode.cs b/src/Microsoft.TestPlatform.ObjectModel/CodeCoverage/TestSDKAutoGeneratedCode.cs index 3e723db06c..9f17f5f3f5 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/CodeCoverage/TestSDKAutoGeneratedCode.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/CodeCoverage/TestSDKAutoGeneratedCode.cs @@ -5,7 +5,7 @@ namespace Microsoft.VisualStudio.TestPlatform { using System; /// - /// Only to be used to Testplatform, to exclude autogenerated code from CodeCoverage + /// Only to be used to Test platform, to exclude auto generated code from CodeCoverage /// public class TestSDKAutoGeneratedCode : Attribute { diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/FileHelper.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/FileHelper.cs index c4d8ec9f80..7dc96331c6 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/FileHelper.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Common/FileHelper.cs @@ -72,14 +72,14 @@ internal static bool IsReservedFileName(string fileName) } // CreateFile: - // The following reserved device names cannot be used as the name of a file: - // CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, - // LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. + // The following reserved device names cannot be used as the name of a file: + // CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, + // LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. // Also avoid these names followed by an extension, for example, NUL.tx7. // Windows NT: CLOCK$ is also a reserved device name. return ReservedFileNamesRegex.Match(fileName).Success; } - + #endregion } } diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionContext.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionContext.cs index 34b00bd336..93cd1d125a 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionContext.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionContext.cs @@ -16,7 +16,7 @@ public class DataCollectionContext // NOTE: These constructors are protected internal to allow 3rd parties to // do unit testing of their data collectors. - // + // // We do not want to make the constructors of this class public as it // would lead to a great deal of user error when they start creating // their own data collection context instances to log errors/warnings diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionRunSettings.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionRunSettings.cs index ee59052a16..37c196364b 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionRunSettings.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionRunSettings.cs @@ -127,7 +127,7 @@ public static DataCollectionRunSettings FromXml(XmlReader reader, string dataCol } public static DataCollectionRunSettings CreateDataCollectionRunSettings( - XmlReader reader, string dataCollectionName, + XmlReader reader, string dataCollectionName, string dataCollectorsName, string dataCollectorName) { ValidateArg.NotNull(reader, "reader"); diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionSink.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionSink.cs index 0ba739b967..8a790b9310 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionSink.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/DataCollectionSink.cs @@ -14,7 +14,7 @@ public abstract class DataCollectionSink #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// protected DataCollectionSink() { diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/DataCollectionEvents.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/DataCollectionEvents.cs index 885cf7d073..f7dadc2a29 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/DataCollectionEvents.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/DataCollectionEvents.cs @@ -13,7 +13,7 @@ public abstract class DataCollectionEvents #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// protected DataCollectionEvents() { diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/TestHostLaunchedEvent.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/TestHostLaunchedEvent.cs index 2f330401a3..fb437411e0 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/TestHostLaunchedEvent.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/Events/TestHostLaunchedEvent.cs @@ -35,9 +35,9 @@ public int TestHostProcessId #endregion #region Constructor - + /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Data collection context diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/TransferInformation/BaseTransferInformation.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/TransferInformation/BaseTransferInformation.cs index 9e42efdde2..0f982750bd 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/TransferInformation/BaseTransferInformation.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/TransferInformation/BaseTransferInformation.cs @@ -17,7 +17,7 @@ public abstract class BasicTransferInformation #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The data collection context for the transfer. @@ -79,7 +79,7 @@ public string Description public RequestId RequestId { get; set; } /// - /// Gets a value indicating whether cleanup should be performed after transferring the resource. This + /// Gets a value indicating whether cleanup should be performed after transferring the resource. This /// can be known by different names in the derived classes so it is protected internal /// so that we can refer to it in a consistent way. /// @@ -89,7 +89,7 @@ protected internal abstract bool PerformCleanup } /// - /// Gets the name of the file to use on the client machine. This + /// Gets the name of the file to use on the client machine. This /// can be known by different names in the derived classes so it is protected internal /// so that we can refer to it in a consistent way. /// diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/TransferInformation/FileTransferInformation.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/TransferInformation/FileTransferInformation.cs index cb7cad2ae1..d6cc636665 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/TransferInformation/FileTransferInformation.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/TransferInformation/FileTransferInformation.cs @@ -10,14 +10,14 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection /// /// Represents required and optional information needed for requesting a file transfer. - /// + /// public class FileTransferInformation : BasicTransferInformation { private readonly IFileHelper fileHelper; #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The context in which the file is being sent. Cannot be null. @@ -34,7 +34,7 @@ public FileTransferInformation(DataCollectionContext context, string path, bool } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The context in which the file is being sent. Cannot be null. diff --git a/src/Microsoft.TestPlatform.ObjectModel/DefaultExecutorUriAttribute.cs b/src/Microsoft.TestPlatform.ObjectModel/DefaultExecutorUriAttribute.cs index 5828d68939..d208cd0a42 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DefaultExecutorUriAttribute.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DefaultExecutorUriAttribute.cs @@ -8,7 +8,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel using Microsoft.VisualStudio.TestPlatform.ObjectModel.Resources; /// - /// This attribute is applied on the discoverers to inform the framework about their default executor. + /// This attribute is applied on the discoverers to inform the framework about their default executor. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public sealed class DefaultExecutorUriAttribute : Attribute diff --git a/src/Microsoft.TestPlatform.ObjectModel/ExceptionConverter.cs b/src/Microsoft.TestPlatform.ObjectModel/ExceptionConverter.cs index 1ce23705e6..cf59e85610 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/ExceptionConverter.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/ExceptionConverter.cs @@ -40,7 +40,7 @@ public static class ExceptionConverter [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0")] public static Exception ConvertException(FaultException faultEx) { - ValidateArg.NotNull(faultEx, "faultEx"); + ValidateArg.NotNull(faultEx, "faultEx"); if (faultEx.Code == null || faultEx.Code.Name == null) { return new TestPlatformException(faultEx.Message, faultEx); @@ -49,7 +49,7 @@ public static Exception ConvertException(FaultException faultEx) } /// - /// Creates a strongly-typed exception that is represented by the exception name + /// Creates a strongly-typed exception that is represented by the exception name /// passed as parameter /// /// Exception type class name diff --git a/src/Microsoft.TestPlatform.ObjectModel/FileExtensionAttribute.cs b/src/Microsoft.TestPlatform.ObjectModel/FileExtensionAttribute.cs index 0000c9a8c0..903dfd2392 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/FileExtensionAttribute.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/FileExtensionAttribute.cs @@ -19,7 +19,7 @@ public sealed class FileExtensionAttribute : Attribute #region Constructor /// - /// Initializes with a file extension that the test discoverer can process tests from. + /// Initializes with a file extension that the test discoverer can process tests from. /// For example ".dll" or ".exe". /// /// The file extensions that the test discoverer can process tests from. diff --git a/src/Microsoft.TestPlatform.ObjectModel/Host/ITestRunTimeProvider.cs b/src/Microsoft.TestPlatform.ObjectModel/Host/ITestRunTimeProvider.cs index 187f83e078..091f2a1a7f 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Host/ITestRunTimeProvider.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Host/ITestRunTimeProvider.cs @@ -99,7 +99,7 @@ public interface ITestRuntimeProvider /// /// Gets path of test sources, based on RuntimeProvider, and where the test is actually deployed(Remote Scenario). /// A test host manager may choose to accept input source as XML file, and provide appropriate source(dll/exe) which the adapters can actually consume - /// E.g. for UWP, input source could be "appxrecipe" file, which gives information about actual source exe. + /// E.g. for UWP, input source could be "appx recipe" file, which gives information about actual source exe. /// /// List of test sources. /// Updated List of test sources based on remote/local scenario. diff --git a/src/Microsoft.TestPlatform.ObjectModel/Logging/Events/TestResultEventArgs.cs b/src/Microsoft.TestPlatform.ObjectModel/Logging/Events/TestResultEventArgs.cs index 337df8009d..06ca8fa203 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Logging/Events/TestResultEventArgs.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Logging/Events/TestResultEventArgs.cs @@ -13,7 +13,7 @@ public class TestResultEventArgs : EventArgs #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Test Result for the event. diff --git a/src/Microsoft.TestPlatform.ObjectModel/Logging/Events/TestRunMessageEventArgs.cs b/src/Microsoft.TestPlatform.ObjectModel/Logging/Events/TestRunMessageEventArgs.cs index 82fb239c1a..c97fd76d9e 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Logging/Events/TestRunMessageEventArgs.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Logging/Events/TestRunMessageEventArgs.cs @@ -46,7 +46,7 @@ public TestRunMessageEventArgs(TestMessageLevel level, string message) /// [DataMember] public string Message { get; set; } - + /// /// Level of the message. /// diff --git a/src/Microsoft.TestPlatform.ObjectModel/Logging/TestMessageLevel.cs b/src/Microsoft.TestPlatform.ObjectModel/Logging/TestMessageLevel.cs index 0bffc4e5b2..1c4c2e8303 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Logging/TestMessageLevel.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Logging/TestMessageLevel.cs @@ -14,12 +14,12 @@ public enum TestMessageLevel /// Informational message. /// Informational = 0, - + /// /// Warning message. /// Warning = 1, - + /// /// Error message. /// diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/DiaNavigationData.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/DiaNavigationData.cs index c20fb49dad..0752a50ef5 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/DiaNavigationData.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/DiaNavigationData.cs @@ -4,10 +4,9 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel { - using System.Diagnostics.CodeAnalysis; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Navigation; - + /// /// A struct that stores the information needed by the navigation: file name, line number, column number. /// @@ -27,5 +26,4 @@ public DiaNavigationData(string fileName, int minLineNumber, int maxLineNumber) this.MaxLineNumber = maxLineNumber; } } - -} \ No newline at end of file +} diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/FullSymbolReader.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/FullSymbolReader.cs index 3446cad579..62d80d4fab 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/FullSymbolReader.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/FullSymbolReader.cs @@ -211,7 +211,7 @@ private DiaNavigationData GetSymbolNavigationData(IDiaSymbol symbol) // Get endline lineNumber.GetLineNumberEnd(out uint endLine); - + // The magic hex constant below works around weird data reported from GetSequencePoints. // The constant comes from ILDASM's source code, which performs essentially the same test. const uint Magic = 0xFEEFEE; @@ -450,7 +450,7 @@ private IDiaSymbol GetMethodSymbol(IDiaSymbol typeSymbol, string methodName) } /// - /// Update the method symbol cache. + /// Update the method symbol cache. /// private static void UpdateMethodSymbolCache(string methodName, IDiaSymbol methodSymbol, Dictionary methodSymbolCache) { @@ -458,8 +458,8 @@ private static void UpdateMethodSymbolCache(string methodName, IDiaSymbol method Debug.Assert(methodSymbol != null, "Method symbol cannot be null."); Debug.Assert(methodSymbolCache != null, "Method symbol cache cannot be null."); - // #827589, In case a type has overloaded methods, then there could be a method already in the - // cache which should be disposed. + // #827589, In case a type has overloaded methods, then there could be a method already in the + // cache which should be disposed. if (methodSymbolCache.TryGetValue(methodName, out IDiaSymbol oldSymbol)) { ReleaseComObject(ref oldSymbol); diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/ISymbolReader.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/ISymbolReader.cs index c593d7f317..83e3108c23 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/ISymbolReader.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/ISymbolReader.cs @@ -7,7 +7,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Navigation using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; - + /// /// Caches filename and line number for symbols in assembly. /// diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/NativeMethods.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/NativeMethods.cs index 54f176beac..440c155751 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/NativeMethods.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/NativeMethods.cs @@ -573,7 +573,7 @@ public static IDiaDataSource GetDiaSourceObject() return (comObject as IDiaDataSource); } - #region private + #region Private [ComImport, ComVisible(false), Guid("00000001-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortablePdbReader.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortablePdbReader.cs index 59e979c9a0..b51d5091d4 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortablePdbReader.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortablePdbReader.cs @@ -15,7 +15,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Navigation internal class PortablePdbReader : IDisposable { /// - /// Use to get method token + /// Use to get method token /// private static readonly PropertyInfo MethodInfoMethodTokenProperty = typeof(MethodInfo).GetProperty("MetadataToken"); @@ -63,7 +63,7 @@ public void Dispose() } /// - /// Gets dia navigation data from Metadata reader + /// Gets dia navigation data from Metadata reader /// /// /// Method info. diff --git a/src/Microsoft.TestPlatform.ObjectModel/RegistryFreeActivationContext.cs b/src/Microsoft.TestPlatform.ObjectModel/RegistryFreeActivationContext.cs index 710316dcfc..a402c7ccaa 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/RegistryFreeActivationContext.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/RegistryFreeActivationContext.cs @@ -23,7 +23,7 @@ internal class RegistryFreeActivationContext : IDisposable private string manifestFilePath = string.Empty; /// - /// Initializes a new instance of RegistryFreeActivationContext class. + /// Initializes a new instance of RegistryFreeActivationContext class. /// ///Manifest file path. public RegistryFreeActivationContext(string manifest) @@ -32,7 +32,7 @@ public RegistryFreeActivationContext(string manifest) } /// - /// Finalize an instance of RegistryFreeActivationContext class. + /// Finalize an instance of RegistryFreeActivationContext class. /// ~RegistryFreeActivationContext() { @@ -77,7 +77,7 @@ protected virtual void Dispose(bool disposing) { if (disposing) { - // No managed resources to release + // No managed resources to release } this.DeactivateContext(); @@ -104,7 +104,7 @@ private void DeactivateContext() } catch (Exception ex) { - // Log any exceptions during deactivation. + // Log any exceptions during deactivation. if (EqtTrace.IsErrorEnabled) { EqtTrace.Error(ex); diff --git a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs index ec220d0a30..5656640d21 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs @@ -28,7 +28,7 @@ public class RunConfiguration : TestRunSettings /// Maximum number of cores that the engine can use to run tests in parallel /// private int maxCpuCount; - + /// /// .Net framework which rocksteady should use for discovery/execution /// @@ -45,7 +45,7 @@ public class RunConfiguration : TestRunSettings private long testSessionTimeout; /// - /// Directory in which rocksteady/adapter should keep their run specific data. + /// Directory in which rocksteady/adapter should keep their run specific data. /// private string resultsDirectory; @@ -65,7 +65,7 @@ public class RunConfiguration : TestRunSettings private bool disableParallelization; /// - /// True if test run is triggered + /// True if test run is triggered /// private bool designMode; @@ -89,7 +89,7 @@ public class RunConfiguration : TestRunSettings #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public RunConfiguration() : base(Constants.RunConfigurationSettingsName) { @@ -190,7 +190,7 @@ public long TestSessionTimeout } } - /// + /// /// Gets or sets the design mode value. /// public bool DesignMode @@ -207,7 +207,7 @@ public bool DesignMode } } - /// + /// /// Gets or sets a value indicating whether to run tests in isolation or not. /// public bool InIsolation diff --git a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/SettingsNameAttribute.cs b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/SettingsNameAttribute.cs index e7f4e9a7f0..cdb2dabd78 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/SettingsNameAttribute.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/SettingsNameAttribute.cs @@ -26,7 +26,7 @@ public SettingsNameAttribute(string settingsName) { throw new ArgumentException(CommonResources.CannotBeNullOrEmpty, "settingsName"); } - + SettingsName = settingsName; } @@ -38,7 +38,7 @@ public SettingsNameAttribute(string settingsName) /// The name of the settings. /// public string SettingsName { get; private set; } - + #endregion } } diff --git a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/TestRunSettings.cs b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/TestRunSettings.cs index 5d0dfeed87..06e18f13b4 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/TestRunSettings.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/TestRunSettings.cs @@ -31,15 +31,15 @@ protected TestRunSettings(string name) /// /// Gets the name of the test settings. - /// Do not put a private setter on this + /// Do not put a private setter on this /// Chutzpah adapter checks for setters of all properties and it throws error if its private /// during RunSettings.LoadSection() call - /// TODO: Communicate to Chutzpah and fix it + /// TODO: Communicate to Chutzpah and fix it /// public string Name => name; #endregion - + /// /// Converter the setting to be an XmlElement. /// diff --git a/src/Microsoft.TestPlatform.ObjectModel/TestCase.cs b/src/Microsoft.TestPlatform.ObjectModel/TestCase.cs index 6eab3923eb..6e7b9669b8 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/TestCase.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/TestCase.cs @@ -21,7 +21,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel public sealed class TestCase : TestObject { /// - /// LocalExtensionData which can be used by Adapter developers for local transfer of extended properties. + /// LocalExtensionData which can be used by Adapter developers for local transfer of extended properties. /// Note that this data is available only for in-Proc execution, and may not be available for OutProc executors /// private Object localExtensionData; @@ -72,7 +72,7 @@ public TestCase(string fullyQualifiedName, Uri executorUri, string source) #region Properties /// - /// LocalExtensionData which can be used by Adapter developers for local transfer of extended properties. + /// LocalExtensionData which can be used by Adapter developers for local transfer of extended properties. /// Note that this data is available only for in-Proc execution, and may not be available for OutProc executors /// public Object LocalExtensionData diff --git a/src/Microsoft.TestPlatform.ObjectModel/TestObject.cs b/src/Microsoft.TestPlatform.ObjectModel/TestObject.cs index 53309900a0..2520e1286d 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/TestObject.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/TestObject.cs @@ -190,9 +190,9 @@ public void RemovePropertyValue(TestProperty property) this.store.Remove(property); } } - + /// - /// Returns TestProperty's value + /// Returns TestProperty's value /// /// property's value. default value is returned if the property is not present public T GetPropertyValue(TestProperty property, T defaultValue, CultureInfo culture) diff --git a/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs b/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs index a5334b5f2b..34c6f09cca 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs @@ -156,7 +156,7 @@ public override string ToString() } /// - /// Gets the valueType. + /// Gets the valueType. /// /// Only works for the valueType that is in the currently executing assembly or in Mscorlib.dll. The default valueType is of string valueType. /// The valueType of the test property diff --git a/src/Microsoft.TestPlatform.ObjectModel/TestResult.cs b/src/Microsoft.TestPlatform.ObjectModel/TestResult.cs index 6255cd8bc3..c5a629ec60 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/TestResult.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/TestResult.cs @@ -34,7 +34,7 @@ public TestResult(TestCase testCase) this.Messages = new Collection(); this.Attachments = new Collection(); - // Default start and end time values for a test result are initialized to current timestamp + // Default start and end time values for a test result are initialized to current time stamp // to maintain compatibility. this.StartTime = DateTimeOffset.UtcNow; this.EndTime = DateTimeOffset.UtcNow; diff --git a/src/Microsoft.TestPlatform.ObjectModel/Trait.cs b/src/Microsoft.TestPlatform.ObjectModel/Trait.cs index 3847c671fc..0bfa8efa34 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Trait.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Trait.cs @@ -8,7 +8,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel using System.Runtime.Serialization; /// - /// Class that holds Trait. + /// Class that holds Trait. /// A traits is Name, Value pair. /// #if NET451 diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyHelper.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyHelper.cs index 79df51f824..36906b8cd9 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyHelper.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyHelper.cs @@ -43,9 +43,9 @@ public static class AssemblyHelper // In Dev10 by devenv uses its own app domain host which has default optimization to share everything. // Set LoaderOptimization to MultiDomainHost which means: - // Indicates that the application will probably host unique code in multiple domains, - // and the loader must share resources across application domains only for globally available (strong-named) - // assemblies that have been added to the global assembly cache. + // Indicates that the application will probably host unique code in multiple domains, + // and the loader must share resources across application domains only for globally available (strong-named) + // assemblies that have been added to the global assembly cache. setupInfo.LoaderOptimization = LoaderOptimization.MultiDomainHost; AppDomain ad = null; @@ -163,8 +163,8 @@ public static KeyValuePair GetFrameworkVersionAn /// /// Returns the full name (AssemblyName.FullName) of the referenced assemblies by the assembly on the specified path. - /// - /// Returns null on failure and an empty array if there is no reference in the project. + /// + /// Returns null on failure and an empty array if there is no reference in the project. /// /// Full path to the assembly to get dependencies for. public static string[] GetReferencedAssemblies(string source) @@ -176,9 +176,9 @@ public static string[] GetReferencedAssemblies(string source) // In Dev10 by devenv uses its own app domain host which has default optimization to share everything. // Set LoaderOptimization to MultiDomainHost which means: - // Indicates that the application will probably host unique code in multiple domains, - // and the loader must share resources across application domains only for globally available (strong-named) - // assemblies that have been added to the global assembly cache. + // Indicates that the application will probably host unique code in multiple domains, + // and the loader must share resources across application domains only for globally available (strong-named) + // assemblies that have been added to the global assembly cache. setupInfo.LoaderOptimization = LoaderOptimization.MultiDomainHost; AppDomain ad = null; @@ -240,7 +240,7 @@ public static void SetAppDomainFrameworkVersionBasedOnTestSource(AppDomainSetup /// Get the target dot net framework string for the assembly /// /// Path of the assembly file - /// String representation of the the target dot net framework e.g. .NETFramework,Version=v4.0 + /// String representation of the target dot net framework e.g. .NETFramework,Version=v4.0 internal static string GetTargetFrameworkVersionString(string path) { Debug.Assert(!string.IsNullOrEmpty(path)); @@ -250,9 +250,9 @@ internal static string GetTargetFrameworkVersionString(string path) // In Dev10 by devenv uses its own app domain host which has default optimization to share everything. // Set LoaderOptimization to MultiDomainHost which means: - // Indicates that the application will probably host unique code in multiple domains, - // and the loader must share resources across application domains only for globally available (strong-named) - // assemblies that have been added to the global assembly cache. + // Indicates that the application will probably host unique code in multiple domains, + // and the loader must share resources across application domains only for globally available (strong-named) + // assemblies that have been added to the global assembly cache. setupInfo.LoaderOptimization = LoaderOptimization.MultiDomainHost; if (File.Exists(path)) diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs index 0ced1c11e5..11be2f2f69 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/AssemblyLoadWorker.cs @@ -11,7 +11,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities using System.Reflection; /// - /// Does the real work of finding references using Assembly.ReflectionOnlyLoadFrom. + /// Does the real work of finding references using Assembly.ReflectionOnlyLoadFrom. /// The caller is supposed to create AppDomain and create instance of given class in there. /// internal class AssemblyLoadWorker : MarshalByRefObject @@ -77,8 +77,8 @@ internal static string GetTargetFrameworkStringFromAssembly(Assembly assembly) /// /// Returns the full name of the referenced assemblies by the assembly on the specified path. - /// - /// Returns null on failure and an empty array if there is no reference in the project. + /// + /// Returns null on failure and an empty array if there is no reference in the project. /// /// Path to the assembly file to load from. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Being created in a separate app-domain"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] @@ -89,9 +89,9 @@ public string[] GetReferencedAssemblies(string path) Assembly a = null; try { - // ReflectionOnlyLoadFrom does not use the probing paths and loads from the - // specified path only and does not let code to be executed by the assembly - // in the loaded context. + // ReflectionOnlyLoadFrom does not use the probing paths and loads from the + // specified path only and does not let code to be executed by the assembly + // in the loaded context. a = Assembly.ReflectionOnlyLoadFrom(path); } catch @@ -119,12 +119,12 @@ public string[] GetReferencedAssemblies(string path) Assembly a = null; try { - // ReflectionOnlyLoadFrom does not use the probing paths and loads from the - // specified path only and does not let code to be executed by the assembly - // in the loaded context. + // ReflectionOnlyLoadFrom does not use the probing paths and loads from the + // specified path only and does not let code to be executed by the assembly + // in the loaded context. // a = Assembly.ReflectionOnlyLoadFrom(path); - + Debug.Assert(a != null); AssemblyName[] assemblies = a.GetReferencedAssemblies(); @@ -179,19 +179,19 @@ public void GetPlatformAndFrameworkSettings(string path, out string procArchType { procArchType = Architecture.Default.ToString(); frameworkVersion = String.Empty; - + try { - // ReflectionOnlyLoadFrom does not use the probing paths and loads from the - // specified path only and does not let code to be executed by the assembly - // in the loaded context. + // ReflectionOnlyLoadFrom does not use the probing paths and loads from the + // specified path only and does not let code to be executed by the assembly + // in the loaded context. var a = Assembly.ReflectionOnlyLoadFrom(path); Debug.Assert(a != null); PortableExecutableKinds peKind; ImageFileMachine machine; a.ManifestModule.GetPEKind(out peKind, out machine); - + // conversion to string type is needed for below reason // -- PortableExecutableKinds.Preferred32Bit and ImageFileMachine.ARM is available only // in .Net4.0 and above. Below code is compiled with .Net3.5 but runs in .Net4.0 @@ -292,7 +292,7 @@ private static string GetArchitectureForSource(string imagePath) const int IMAGE_FILE_MACHINE_ARM = 0x01c0; // ARM Little-Endian const int IMAGE_FILE_MACHINE_THUMB = 0x01c2; // ARM Thumb/Thumb-2 Little-Endian const int IMAGE_FILE_MACHINE_ARMNT = 0x01c4; // ARM Thumb-2 Little-Endian - + try { //get the input stream diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/FilterHelper.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/FilterHelper.cs index 9abb7086bc..7f7408b936 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/FilterHelper.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/FilterHelper.cs @@ -6,7 +6,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities using System; using System.Collections.Generic; using System.Globalization; - using System.Text; + using System.Text; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Resources; public static class FilterHelper @@ -16,7 +16,7 @@ public static class FilterHelper private static readonly HashSet SpecialCharactersSet = new HashSet(SpecialCharacters); /// - /// Escapes a set of special characters for filter (%, (, ), &, |, =, !, ~) by replacing them with their escape sequences. + /// Escapes a set of special characters for filter (%, (, ), &, |, =, !, ~) by replacing them with their escape sequences. /// /// The input string that contains the text to convert. /// A string of characters with special characters converted to their escaped form. @@ -76,7 +76,7 @@ public static string Unescape(string str) } } - // Strictly speaking, string to be un-escaped shouldn't contain any of the special characters, + // Strictly speaking, string to be un-escaped shouldn't contain any of the special characters, // other than being part of escape sequence, but we will ignore that to avoid additional overhead. builder.Append(currentChar); diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlReaderUtilities.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlReaderUtilities.cs index 5f72e224b3..dcfadeea4d 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlReaderUtilities.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlReaderUtilities.cs @@ -55,7 +55,7 @@ public static void SkipToNextElement(this XmlReader reader) public static void ReadToRootNode(XmlReader reader) { ValidateArg.NotNull(reader, "reader"); - + // Read to the root node. reader.ReadToNextElement(); diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlRunSettingsUtilities.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlRunSettingsUtilities.cs index 9a81dbb999..6d367c9326 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlRunSettingsUtilities.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlRunSettingsUtilities.cs @@ -144,7 +144,7 @@ public static void InsertDataCollectorsNode(IXPathNavigable runSettingDocument, } /// - /// Returns RunConfiguration from settingsXml. + /// Returns RunConfiguration from settingsXml. /// /// The run settings. /// The RunConfiguration node as defined in the settings xml. @@ -230,7 +230,7 @@ public static bool IsDataCollectionEnabled(string runSettingsXml) } /// - /// Returns whether in proc data collection is enabled in the parameter settings xml or not + /// Returns whether in-proc data collection is enabled in the parameter settings xml or not /// /// The run Settings Xml. /// True if data collection is enabled. @@ -283,7 +283,7 @@ public static DataCollectionRunSettings GetDataCollectionRunSettings(string runS return null; } - // Reached here => DC element present. + // Reached here => DC element present. return DataCollectionRunSettings.FromXml(reader); } } diff --git a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs index cba287f288..6e571f8bb3 100644 --- a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs +++ b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs @@ -190,7 +190,7 @@ public virtual TestProcessStartInfo GetTestHostProcessStartInfo( var sourceFile = Path.GetFileNameWithoutExtension(sourcePath); var sourceDirectory = Path.GetDirectoryName(sourcePath); - // Probe for runtimeconfig and deps file for the test source + // Probe for runtime config and deps file for the test source var runtimeConfigPath = Path.Combine(sourceDirectory, string.Concat(sourceFile, ".runtimeconfig.json")); if (this.fileHelper.Exists(runtimeConfigPath)) { diff --git a/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs b/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs index e039c85c2d..544736d26a 100644 --- a/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs +++ b/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs @@ -96,7 +96,7 @@ public static string MakeRunsettingsCompatible(string runsettingsXml) "DisableAppDomain" }; - // Find all invalid RunConfiguration Settings + // Find all invalid RunConfiguration Settings runSettingsNavigator.MoveToFirstChild(); do { @@ -239,7 +239,7 @@ public static bool AreRunSettingsCollectorsInCompatibleWithTestSettings(string r return false; } - // Explicitly blocking usage of data collectors through modes runsettings and testsettings except + // Explicitly blocking usage of data collectors through modes runsettings and testsettings except // for couple of scenarios where the IDE generates the collector settings in the runsettings file even when // it has an embedded testsettings file. Longterm runsettings will be the single run configuration source // In-proc collectors are incompatible with testsettings @@ -256,7 +256,7 @@ public static bool AreRunSettingsCollectorsInCompatibleWithTestSettings(string r } } - // TestSettings and collection is enabled in runsetttings.. the only allowed collectors are codecoverage and fakes + // TestSettings and collection is enabled in runsetttings.. the only allowed collectors are code coverage and fakes var datacollectionSettings = XmlRunSettingsUtilities.GetDataCollectionRunSettings(runsettings); if (datacollectionSettings != null && datacollectionSettings.IsCollectionEnabled && datacollectionSettings.DataCollectorSettingsList != null) { @@ -337,7 +337,7 @@ public static bool TryGetLegacySettingElements(string runsettingsXml, out Dictio { legacySettingsTelemetry.Add(LegacyElementsString, string.Join(", ", legacySettingElements)); } - + var deploymentNode = runSettingsNavigator.SelectSingleNode(@"/RunSettings/LegacySettings/Deployment"); var deploymentAttributes = GetNodeAttributes(deploymentNode); if (deploymentAttributes != null) diff --git a/src/Microsoft.TestPlatform.Utilities/MSTestSettingsUtilities.cs b/src/Microsoft.TestPlatform.Utilities/MSTestSettingsUtilities.cs index 3f3cdf51ed..1d7abed540 100644 --- a/src/Microsoft.TestPlatform.Utilities/MSTestSettingsUtilities.cs +++ b/src/Microsoft.TestPlatform.Utilities/MSTestSettingsUtilities.cs @@ -20,7 +20,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Utilities public static class MSTestSettingsUtilities { /// - /// Imports the parameter settings file in the default runsettings. + /// Imports the parameter settings file in the default runsettings. /// /// /// Settings file which need to be imported. The file extension of the settings file will be specified by property. @@ -49,10 +49,10 @@ public static XmlDocument Import(string settingsFile, XmlDocument defaultRunSett } var settingsNode = GenerateMSTestXml(settingsFile); - + defaultRunSettings.DocumentElement.PrependChild(defaultRunSettings.ImportNode(settingsNode, true)); - // Adding RunConfig + // Adding RunConfig if (!navigator.MoveToChild(Constants.RunConfigurationSettingsName, string.Empty)) { var doc = new XmlDocument(); diff --git a/src/Microsoft.TestPlatform.Utilities/XmlUtilities.cs b/src/Microsoft.TestPlatform.Utilities/XmlUtilities.cs index 9b97a0f5ef..4da189fda7 100644 --- a/src/Microsoft.TestPlatform.Utilities/XmlUtilities.cs +++ b/src/Microsoft.TestPlatform.Utilities/XmlUtilities.cs @@ -58,7 +58,7 @@ internal static void AppendOrModifyChild( { var childNode = xmlDocument.SelectSingleNode(nodeXPath); - // TODO: There isn't an equivalent API to SecurityElement.Escape in Core yet. + // TODO: There isn't an equivalent API to SecurityElement.Escape in Core yet. // So trusting that the XML is always valid for now. #if NET451 var secureInnerXml = SecurityElement.Escape(innerXml); diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IProcessManager.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IProcessManager.cs index aad7c121e3..82c71a1eef 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IProcessManager.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IProcessManager.cs @@ -6,12 +6,12 @@ namespace Microsoft.TestPlatform.VsTestConsole.TranslationLayer.Interfaces using System; /// - /// Defines the interface that can manage a process + /// Defines the interface that can manage a process /// internal interface IProcessManager { /// - /// Starts the Process + /// Starts the Process /// void StartProcess(ConsoleParameters consoleParameters); diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITranslationLayerRequestSender.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITranslationLayerRequestSender.cs index bf8beeea6d..aabf810570 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITranslationLayerRequestSender.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITranslationLayerRequestSender.cs @@ -22,19 +22,19 @@ internal interface ITranslationLayerRequestSender : IDisposable int InitializeCommunication(); /// - /// Waits for Request Handler to be connected + /// Waits for Request Handler to be connected /// /// Time to wait for connection /// True, if Handler is connected bool WaitForRequestHandlerConnection(int connectionTimeout); /// - /// Close the Sender + /// Close the Sender /// void Close(); /// - /// Initializes the Extensions while probing additional extension paths + /// Initializes the Extensions while probing additional extension paths /// /// Paths to check for additional extensions void InitializeExtensions(IEnumerable pathToAdditionalExtensions); diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleProcessManager.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleProcessManager.cs index a89b5f2431..e57b34641a 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleProcessManager.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleProcessManager.cs @@ -159,7 +159,7 @@ public void ShutdownProcess() SafelyTerminateProcess(); this.process.Dispose(); this.process = null; - } + } } private void SafelyTerminateProcess() diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleRequestSender.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleRequestSender.cs index d45dd5f00e..c5053dbf7a 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleRequestSender.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleRequestSender.cs @@ -598,7 +598,7 @@ private void SendMessageAndListenAndReportTestResults(string messageType, object this.communicationManager.SendMessage(messageType, payload, this.protocolVersion); var isTestRunComplete = false; - // Cycle through the messages that the testhost sends. + // Cycle through the messages that the testhost sends. // Currently each of the operations are not separate tasks since they should not each take much time. This is just a notification. while (!isTestRunComplete) { @@ -661,7 +661,7 @@ private async Task SendMessageAndListenAndReportTestResultsAsync(string messageT this.communicationManager.SendMessage(messageType, payload, this.protocolVersion); var isTestRunComplete = false; - // Cycle through the messages that the testhost sends. + // Cycle through the messages that the testhost sends. // Currently each of the operations are not separate tasks since they should not each take much time. This is just a notification. while (!isTestRunComplete) { diff --git a/src/testhost.x86/AppDomainEngineInvoker.cs b/src/testhost.x86/AppDomainEngineInvoker.cs index 7859e5961b..101c0a878b 100644 --- a/src/testhost.x86/AppDomainEngineInvoker.cs +++ b/src/testhost.x86/AppDomainEngineInvoker.cs @@ -129,7 +129,7 @@ private void SetConfigurationFile(AppDomainSetup appDomainSetup, string testSour var userConfigDoc = XDocument.Load(userConfigFile); var testHostConfigDoc = XDocument.Load(testHostAppConfigFile); - // Merge user's config file and testHost config file and use merged one + // Merge user's config file and testHost config file and use merged one var mergedConfigDocument = MergeApplicationConfigFiles(userConfigDoc, testHostConfigDoc); // Create a temp file with config @@ -172,11 +172,11 @@ protected static XDocument MergeApplicationConfigFiles(XDocument userConfigDoc, // Start with User's config file as the base var mergedDoc = new XDocument(userConfigDoc); - // Take testhost.exe Startup node + // Take testhost.exe Startup node var startupNode = testHostConfigDoc.Descendants("startup")?.FirstOrDefault(); if (startupNode != null) { - // Remove user's startup and add ours which supports NET35 + // Remove user's startup and add ours which supports NET35 mergedDoc.Descendants("startup")?.Remove(); mergedDoc.Root.Add(startupNode); } diff --git a/src/testhost.x86/Program.cs b/src/testhost.x86/Program.cs index bb1f302e95..bd6db273fc 100644 --- a/src/testhost.x86/Program.cs +++ b/src/testhost.x86/Program.cs @@ -55,7 +55,7 @@ public static void Run(string[] args) WaitForDebuggerIfEnabled(); SetCultureSpecifiedByUser(); var argsDictionary = CommandLineArgumentsHelper.GetArgumentsDictionary(args); - + // Invoke the engine with arguments GetEngineInvoker(argsDictionary).Invoke(argsDictionary); } @@ -64,7 +64,7 @@ private static IEngineInvoker GetEngineInvoker(IDictionary argsD { IEngineInvoker invoker = null; #if NET451 - // If Args contains test source argument, invoker Engine in new appdomain + // If Args contains test source argument, invoker Engine in new appdomain string testSourcePath; if (argsDictionary.TryGetValue(TestSourceArgumentString, out testSourcePath) && !string.IsNullOrWhiteSpace(testSourcePath)) { @@ -84,7 +84,7 @@ private static IEngineInvoker GetEngineInvoker(IDictionary argsD } private static void WaitForDebuggerIfEnabled() - { + { // Check if native debugging is enabled and OS is windows. var nativeDebugEnabled = Environment.GetEnvironmentVariable("VSTEST_HOST_NATIVE_DEBUG"); diff --git a/src/vstest.console/CommandLine/CommandArgumentPair.cs b/src/vstest.console/CommandLine/CommandArgumentPair.cs index c75f4ac99b..e710414391 100644 --- a/src/vstest.console/CommandLine/CommandArgumentPair.cs +++ b/src/vstest.console/CommandLine/CommandArgumentPair.cs @@ -7,7 +7,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine using System.Diagnostics.Contracts; using CommandLineResources = Microsoft.VisualStudio.TestPlatform.CommandLine.Resources.Resources; - + /// /// Breaks a string down into command and argument based on the following format: /// /command:argument. @@ -22,7 +22,7 @@ internal class CommandArgumentPair internal const string Separator = ":"; #endregion - + #region Properties /// @@ -65,7 +65,7 @@ public CommandArgumentPair(string command, string argument) { throw new ArgumentException(CommandLineResources.CannotBeNullOrEmpty, "command"); } - + Contract.Ensures(Command == command); Contract.Ensures(Argument == argument); diff --git a/src/vstest.console/CommandLine/CommandLineOptions.cs b/src/vstest.console/CommandLine/CommandLineOptions.cs index 613e14db8c..1ca3e70d75 100644 --- a/src/vstest.console/CommandLine/CommandLineOptions.cs +++ b/src/vstest.console/CommandLine/CommandLineOptions.cs @@ -23,7 +23,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine /// internal class CommandLineOptions { - #region Constants/Readonly + #region Constants/Readonly /// /// The default batch size. @@ -127,12 +127,12 @@ public IEnumerable Sources public bool DisableAutoFakes { get; set; } = false; /// - /// Specifies whether vsixExtensions is enabled or not. + /// Specifies whether vsixExtensions is enabled or not. /// public bool UseVsixExtensions { get; set; } /// - /// Path to the custom test adapters. + /// Path to the custom test adapters. /// public string TestAdapterPath { get; set; } @@ -224,7 +224,7 @@ public bool IsDesignMode } /// - /// If not already set from IDE in the runSettings, ShouldCollectSourceInformation defaults to IsDesignMode value + /// If not already set from IDE in the runSettings, ShouldCollectSourceInformation defaults to IsDesignMode value /// public bool ShouldCollectSourceInformation { diff --git a/src/vstest.console/CommandLine/Executor.cs b/src/vstest.console/CommandLine/Executor.cs index 58466b139a..b4642db4fc 100644 --- a/src/vstest.console/CommandLine/Executor.cs +++ b/src/vstest.console/CommandLine/Executor.cs @@ -39,7 +39,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine using Microsoft.VisualStudio.TestPlatform.CoreUtilities.Tracing.Interfaces; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.Utilities; - using CommandLineResources = Microsoft.VisualStudio.TestPlatform.CommandLine.Resources.Resources; + using CommandLineResources = Microsoft.VisualStudio.TestPlatform.CommandLine.Resources.Resources; /// /// Performs the execution based on the arguments provided. @@ -307,7 +307,7 @@ private void EnsureActionArgumentIsPresent(List argumentProc Contract.Requires(argumentProcessors != null); Contract.Requires(processorFactory != null); - // Determine if any of the argument processors are actions. + // Determine if any of the argument processors are actions. var isActionIncluded = argumentProcessors.Any((processor) => processor.Metadata.Value.IsAction); // If no action arguments have been provided, then add the default action argument. diff --git a/src/vstest.console/Internal/ConsoleLogger.cs b/src/vstest.console/Internal/ConsoleLogger.cs index fe8fe0078b..33ca43844d 100644 --- a/src/vstest.console/Internal/ConsoleLogger.cs +++ b/src/vstest.console/Internal/ConsoleLogger.cs @@ -144,7 +144,7 @@ internal ConsoleLogger(IOutput output, IProgressIndicator progressIndicator) #endregion - #region Properties + #region Properties /// /// Gets instance of IOutput used for sending output. @@ -380,7 +380,7 @@ private static void DisplayFullInformation(TestResult result) } /// - /// Returns the parent Execution id of given test result. + /// Returns the parent Execution id of given test result. /// /// /// diff --git a/src/vstest.console/Processors/CollectArgumentProcessor.cs b/src/vstest.console/Processors/CollectArgumentProcessor.cs index 9cc904b443..ac5b599a20 100644 --- a/src/vstest.console/Processors/CollectArgumentProcessor.cs +++ b/src/vstest.console/Processors/CollectArgumentProcessor.cs @@ -234,7 +234,7 @@ internal static void AddDataCollectorToRunSettings(string argument, IRunSettings if (string.Equals(argument, CoverletConstants.CoverletDataCollectorFriendlyName, StringComparison.OrdinalIgnoreCase)) { - // Add inproc data collector to runsetings if coverlet code coverage is enabled + // Add in-proc data collector to runsettings if coverlet code coverage is enabled EnableCoverletInProcDataCollector(argument, inProcDataCollectionRunSettings, runSettingsManager, fileHelper); runSettingsManager.UpdateRunSettingsNodeInnerXml(Constants.InProcDataCollectionRunSettingsName, inProcDataCollectionRunSettings.ToXml().InnerXml); } diff --git a/src/vstest.console/Processors/FrameworkArgumentProcessor.cs b/src/vstest.console/Processors/FrameworkArgumentProcessor.cs index d770c72d60..239600c6e3 100644 --- a/src/vstest.console/Processors/FrameworkArgumentProcessor.cs +++ b/src/vstest.console/Processors/FrameworkArgumentProcessor.cs @@ -134,7 +134,7 @@ public void Initialize(string argument) { throw new CommandLineException(CommandLineResources.FrameworkVersionRequired); } - + var validFramework = Framework.FromString(argument); if (validFramework == null) { diff --git a/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs b/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs index 19647d5e55..4411fdc609 100644 --- a/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs +++ b/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs @@ -251,7 +251,6 @@ public void LogWarning(string message) { ConsoleLogger.RaiseTestRunWarning(message); } - public void RegisterDiscoveryEvents(IDiscoveryRequest discoveryRequest) { discoveryRequest.OnDiscoveredTests += this.discoveryRequest_OnDiscoveredTests; diff --git a/src/vstest.console/Processors/ListTestsTargetPathArgumentProcessor.cs b/src/vstest.console/Processors/ListTestsTargetPathArgumentProcessor.cs index 5f3971a5b4..af06b7d0db 100644 --- a/src/vstest.console/Processors/ListTestsTargetPathArgumentProcessor.cs +++ b/src/vstest.console/Processors/ListTestsTargetPathArgumentProcessor.cs @@ -71,7 +71,7 @@ internal class ListTestsTargetPathArgumentProcessorCapabilities : BaseArgumentPr public override bool IsAction => false; - public override ArgumentProcessorPriority Priority => ArgumentProcessorPriority.Normal; + public override ArgumentProcessorPriority Priority => ArgumentProcessorPriority.Normal; } internal class ListTestsTargetPathArgumentExecutor : IArgumentExecutor diff --git a/src/vstest.console/Processors/PlatformArgumentProcessor.cs b/src/vstest.console/Processors/PlatformArgumentProcessor.cs index c4dbc020f6..dcbaa2e239 100644 --- a/src/vstest.console/Processors/PlatformArgumentProcessor.cs +++ b/src/vstest.console/Processors/PlatformArgumentProcessor.cs @@ -73,7 +73,6 @@ public Lazy Executor internal class PlatformArgumentProcessorCapabilities : BaseArgumentProcessorCapabilities { public override string CommandName => PlatformArgumentProcessor.CommandName; - public override bool AllowMultiple => false; public override bool IsAction => false; diff --git a/src/vstest.console/Processors/RunTestsArgumentProcessor.cs b/src/vstest.console/Processors/RunTestsArgumentProcessor.cs index cffaa8f44e..48c962106f 100644 --- a/src/vstest.console/Processors/RunTestsArgumentProcessor.cs +++ b/src/vstest.console/Processors/RunTestsArgumentProcessor.cs @@ -243,8 +243,8 @@ private void TestRunRequest_OnRunCompletion(object sender, TestRunCompleteEventA { var testsFoundInAnySource = (e.TestRunStatistics == null) ? false : (e.TestRunStatistics.ExecutedTests > 0); - // Indicate the user to use testadapterpath command if there are no tests found - if (!testsFoundInAnySource && string.IsNullOrEmpty(CommandLineOptions.Instance.TestAdapterPath) && this.commandLineOptions.TestCaseFilterValue == null) + // Indicate the user to use test adapter path command if there are no tests found + if (!testsFoundInAnySource && string.IsNullOrEmpty(CommandLineOptions.Instance.TestAdapterPath) && this.commandLineOptions.TestCaseFilterValue == null) { this.output.Warning(false, CommandLineResources.SuggestTestAdapterPathIfNoTestsIsFound); } diff --git a/src/vstest.console/Processors/TestAdapterPathArgumentProcessor.cs b/src/vstest.console/Processors/TestAdapterPathArgumentProcessor.cs index daa64e862d..120544e1c8 100644 --- a/src/vstest.console/Processors/TestAdapterPathArgumentProcessor.cs +++ b/src/vstest.console/Processors/TestAdapterPathArgumentProcessor.cs @@ -174,7 +174,7 @@ public void Initialize(string argument) // Remove leading and trailing ' " ' chars... argument = argument.Trim().Trim(new char[] { '\"' }); - // Get testadapter paths from RunSettings. + // Get test adapter paths from RunSettings. var testAdapterPathsInRunSettings = this.runSettingsManager.QueryRunSettingsNode("RunConfiguration.TestAdaptersPaths"); if (!string.IsNullOrWhiteSpace(testAdapterPathsInRunSettings)) diff --git a/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs b/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs index 7d2197ff39..3f10e0143d 100644 --- a/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs +++ b/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs @@ -20,7 +20,7 @@ internal class TestCaseFilterArgumentProcessor : IArgumentProcessor /// The name of the command line argument that the TestCaseFilterArgumentExecutor handles. /// public const string CommandName = "/TestCaseFilter"; - + #endregion private Lazy metadata; @@ -68,7 +68,7 @@ public Lazy Executor internal class TestCaseFilterArgumentProcessorCapabilities : BaseArgumentProcessorCapabilities { public override string CommandName => TestCaseFilterArgumentProcessor.CommandName; - + public override bool AllowMultiple => false; public override bool IsAction => false; diff --git a/src/vstest.console/Processors/TestSourceArgumentProcessor.cs b/src/vstest.console/Processors/TestSourceArgumentProcessor.cs index 8e82e66ce5..f5f7fdfce0 100644 --- a/src/vstest.console/Processors/TestSourceArgumentProcessor.cs +++ b/src/vstest.console/Processors/TestSourceArgumentProcessor.cs @@ -77,7 +77,7 @@ internal class TestSourceArgumentProcessorCapabilities : BaseArgumentProcessorCa /// Argument Executor which handles adding the source provided to the TestManager. /// internal class TestSourceArgumentExecutor : IArgumentExecutor - { + { #region Fields /// diff --git a/src/vstest.console/Processors/UseVsixExtensionsArgumentProcessor.cs b/src/vstest.console/Processors/UseVsixExtensionsArgumentProcessor.cs index 0ca76959c5..b3a29e6ee7 100644 --- a/src/vstest.console/Processors/UseVsixExtensionsArgumentProcessor.cs +++ b/src/vstest.console/Processors/UseVsixExtensionsArgumentProcessor.cs @@ -4,7 +4,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine.Processors { using System; - + using System.Globalization; using Microsoft.VisualStudio.TestPlatform.Client.RequestHelper; using Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers; diff --git a/src/vstest.console/Processors/Utilities/ArgumentProcessorFactory.cs b/src/vstest.console/Processors/Utilities/ArgumentProcessorFactory.cs index 2c5d41a3b3..ed7b76ca31 100644 --- a/src/vstest.console/Processors/Utilities/ArgumentProcessorFactory.cs +++ b/src/vstest.console/Processors/Utilities/ArgumentProcessorFactory.cs @@ -157,7 +157,7 @@ public IArgumentProcessor CreateArgumentProcessor(string argument) argumentProcessor = WrapLazyProcessorToInitializeOnInstantiation(argumentProcessor, pair.Argument); } - return argumentProcessor; + return argumentProcessor; } /// diff --git a/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs b/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs index edf84837bf..08699a5f82 100644 --- a/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs +++ b/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs @@ -301,7 +301,7 @@ public void RunTests(TestRunRequestPayload testRunRequestPayload, ITestHostLaunc private void LogTelemetryForLegacySettings(IRequestData requestData, string runsettings) { requestData.MetricsCollection.Add(TelemetryDataConstants.TestSettingsUsed, InferRunSettingsHelper.IsTestSettingsEnabled(runsettings)); - + if (InferRunSettingsHelper.TryGetLegacySettingElements(runsettings, out Dictionary legacySettingsTelemetry)) { foreach( var ciData in legacySettingsTelemetry) @@ -386,7 +386,7 @@ private bool UpdateRunSettingsIfRequired(string runsettingsXml, List sou // Choose default architecture based on the framework // For .NET core, the default platform architecture should be based on the process. - // For a 64 bit process, + // For a 64 bit process, Architecture defaultArchitecture = Architecture.X86; if (chosenFramework.Name.IndexOf("netstandard", StringComparison.OrdinalIgnoreCase) >= 0 || chosenFramework.Name.IndexOf("netcoreapp", StringComparison.OrdinalIgnoreCase) >= 0) @@ -699,7 +699,7 @@ private void CollectMetrics(IRequestData requestData, RunConfiguration runConfig } /// - /// Checks whether Telemetry opted in or not. + /// Checks whether Telemetry opted in or not. /// By Default opting out /// /// Returns Telemetry Opted out or not diff --git a/test/DataCollectors/TraceDataCollector.UnitTests/VanguardTests.cs b/test/DataCollectors/TraceDataCollector.UnitTests/VanguardTests.cs index a60e00cc4f..f059d70fc7 100644 --- a/test/DataCollectors/TraceDataCollector.UnitTests/VanguardTests.cs +++ b/test/DataCollectors/TraceDataCollector.UnitTests/VanguardTests.cs @@ -127,7 +127,7 @@ public void StartShouldThrowOnInvalidVarguardPath() public void StartShouldThrowOnInvalidCommandLine() { var expectedErrorMessage = - "Running event not received from CodeCoverage.exe. Check eventlogs for failure reason."; + "Running event not received from CodeCoverage.exe. Check event logs for failure reason."; this.vanguardCommandBuilderMock .Setup(c => c.GenerateCommandLine( VanguardCommand.Collect, diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/EventLogCollectorTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/EventLogCollectorTests.cs index 25be74ec1e..563fb7df12 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/EventLogCollectorTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/EventLogCollectorTests.cs @@ -70,15 +70,15 @@ private string GetRunsettingsFilePath() Path.GetTempPath(), "test_" + Guid.NewGuid() + ".runsettings"); - string runSettingsXml = @" - - - 0 - x64 - Framework45 + string runSettingsXml = @" + + + 0 + x64 + Framework45 - - + + @@ -96,15 +96,15 @@ private string GetRunsettingsFilePathWithCustomSource() Path.GetTempPath(), "test_" + Guid.NewGuid() + ".runsettings"); - string runSettingsXml = @" - - - 0 - x64 - Framework45 + string runSettingsXml = @" + + + 0 + x64 + Framework45 - - + + diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/Extension/NetCoreTargetFrameworkDataSource.cs b/test/Microsoft.TestPlatform.AcceptanceTests/Extension/NetCoreTargetFrameworkDataSource.cs index 5a1a5a655d..bbfa6f1050 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/Extension/NetCoreTargetFrameworkDataSource.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/Extension/NetCoreTargetFrameworkDataSource.cs @@ -12,7 +12,7 @@ namespace Microsoft.TestPlatform.AcceptanceTests /// /// The attribute defining runner framework, target framework and target runtime for netcoreapp1.* - /// First Argument (Runner framework) = This decides who will run the tests. If runner framework is netcoreapp then "dotnet vstest.console.dll" will run the tests. + /// First Argument (Runner framework) = This decides who will run the tests. If runner framework is netcoreapp then "dotnet vstest.console.dll" will run the tests. /// If runner framework is net46 then vstest.console.exe will run the tests. /// Second argument (target framework) = The framework for which test will run /// diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/Extension/NetFullTargetFrameworkDataSource.cs b/test/Microsoft.TestPlatform.AcceptanceTests/Extension/NetFullTargetFrameworkDataSource.cs index 23d8f15445..c02c40a2c0 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/Extension/NetFullTargetFrameworkDataSource.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/Extension/NetFullTargetFrameworkDataSource.cs @@ -12,7 +12,7 @@ namespace Microsoft.TestPlatform.AcceptanceTests /// /// The attribute defining runner framework and target framework for net451. - /// First Argument (Runner framework) = This decides who will run the tests. If runner framework is netcoreapp then "dotnet vstest.console.dll" will run the tests. + /// First Argument (Runner framework) = This decides who will run the tests. If runner framework is netcoreapp then "dotnet vstest.console.dll" will run the tests. /// If runner framework is net46 then vstest.console.exe will run the tests. /// Second argument (target framework) = The framework for which test will run /// diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/LoggerTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/LoggerTests.cs index b8bc16f19b..ace9ce77f3 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/LoggerTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/LoggerTests.cs @@ -76,7 +76,7 @@ public void TrxLoggerWithExecutorUriShouldProperlyOverwriteFile(RunnerInfo runne [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] public void TrxLoggerWithLogFilePrefixShouldGenerateMultipleTrx(RunnerInfo runnerInfo) { - AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); + AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); var trxFileNamePattern = "TestResults"; var arguments = PrepareArguments(this.GetSampleTestAssembly(), this.GetTestAdapterPath(), string.Empty, this.FrameworkArgValue, runnerInfo.InIsolationValue); @@ -90,9 +90,9 @@ public void TrxLoggerWithLogFilePrefixShouldGenerateMultipleTrx(RunnerInfo runne var trxFilePaths = Directory.EnumerateFiles(Path.Combine(Directory.GetCurrentDirectory(), "TestResults"), trxFileNamePattern + "_net*.trx"); Assert.IsTrue(trxFilePaths.Count() > 1); - + } - + [TestMethod] [NetCoreTargetFrameworkDataSource] public void HtmlLoggerWithExecutorUriShouldProperlyOverwriteFile(RunnerInfo runnerInfo) diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/Program.cs b/test/Microsoft.TestPlatform.AcceptanceTests/Program.cs index a68294ce79..f51a7b7fe2 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/Program.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. namespace testhost.UnitTests -{ +{ public static class Program { public static void Main(string[] args) diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/RunsettingsTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/RunsettingsTests.cs index a6aa7b0973..5b151c4bfa 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/RunsettingsTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/RunsettingsTests.cs @@ -480,9 +480,9 @@ public void EnvironmentVariablesSettingsShouldSetEnvironmentVariables(RunnerInfo #region RunSettings defined in project file /// - /// RunSettingsFilePath can be specified in .csproj and should be honored by `dotnet test`, this test + /// RunSettingsFilePath can be specified in .csproj and should be honored by `dotnet test`, this test /// checks that the settings were honored by translating an inconclusive test to failed "result", instead of the default "skipped". - /// This test depends on Microsoft.TestPlatform.Build\Microsoft.TestPlatform.targets being previously copied into the + /// This test depends on Microsoft.TestPlatform.Build\Microsoft.TestPlatform.targets being previously copied into the /// artifacts/testArtifacts/dotnet folder. This will allow the local copy of dotnet to pickup the VSTest msbuild task. /// /// @@ -498,9 +498,9 @@ public void RunSettingsAreLoadedFromProject(RunnerInfo runnerInfo) this.InvokeDotnetTest(projectPath); this.ValidateSummaryStatus(0, 1, 0); - // make sure that we can revert the project settings back by providing a config from command line - // keeping this in the same test, because it is easier to see that we are reverting settings that - // are honored by dotnet test, instead of just using the default, which would produce the same + // make sure that we can revert the project settings back by providing a config from command line + // keeping this in the same test, because it is easier to see that we are reverting settings that + // are honored by dotnet test, instead of just using the default, which would produce the same // result var settingsPath = this.GetProjectAssetFullPath(projectName, "inconclusive.runsettings"); this.InvokeDotnetTest($"{projectPath} --settings {settingsPath}"); diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/DiscoverTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/DiscoverTests.cs index a274adf8bc..f62ebd9e28 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/DiscoverTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/DiscoverTests.cs @@ -98,8 +98,8 @@ public void DiscoverTestsUsingEventHandler2AndBatchSize(RunnerInfo runnerInfo) var discoveryEventHandlerForBatchSize = new DiscoveryEventHandlerForBatchSize(); - string runSettingsXml = @" - + string runSettingsXml = @" + 3 @@ -126,8 +126,8 @@ public void DiscoverTestsUsingEventHandler1AndBatchSize(RunnerInfo runnerInfo) var discoveryEventHandlerForBatchSize = new DiscoveryEventHandlerForBatchSize(); - string runSettingsXml = @" - + string runSettingsXml = @" + 3 diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTests.cs index 313cf702cb..a61dfb51c0 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTests.cs @@ -62,7 +62,7 @@ public void EndSessionShouldEnsureVstestConsoleProcessDies(RunnerInfo runnerInfo AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); this.Setup(); - + this.vstestConsoleWrapper.RunTests(this.GetTestAssemblies(), this.GetDefaultRunSettings(), this.runEventHandler); this.vstestConsoleWrapper?.EndSession(); diff --git a/test/Microsoft.TestPlatform.Client.UnitTests/DesignMode/DesignModeClientTests.cs b/test/Microsoft.TestPlatform.Client.UnitTests/DesignMode/DesignModeClientTests.cs index 5b834a3b27..0ce1f8304f 100644 --- a/test/Microsoft.TestPlatform.Client.UnitTests/DesignMode/DesignModeClientTests.cs +++ b/test/Microsoft.TestPlatform.Client.UnitTests/DesignMode/DesignModeClientTests.cs @@ -71,7 +71,7 @@ public void DesignModeClientInitializeShouldInstantiateClassAndCreateClient() public void TestRunMessageHandlerShouldCallCommmunicationManagerIfMessageisError() { this.mockCommunicationManager.Setup(cm => cm.SendMessage(It.IsAny())); - + this.designModeClient.TestRunMessageHandler(new object(), new TestRunMessageEventArgs(TestMessageLevel.Error, "message")); this.mockCommunicationManager.Verify(cm => cm.SendMessage(It.IsAny(),It.IsAny()), Times.Once()); @@ -138,7 +138,7 @@ public void DesignModeClientDuringConnectShouldHighestCommonVersionWhenReceivedV this.mockCommunicationManager.SetupSequence(cm => cm.ReceiveMessage()).Returns(verCheck).Returns(sessionEnd); this.designModeClient.ConnectToClientAndProcessRequests(PortNumber, this.mockTestRequestManager.Object); - + this.mockCommunicationManager.Verify(cm => cm.SendMessage(MessageType.VersionCheck, this.protocolVersion), Times.Once()); } @@ -200,7 +200,7 @@ public void DesignModeClientWithGetTestRunnerProcessStartInfoShouldDeserializeTe this.mockCommunicationManager.SetupSequence(cm => cm.ReceiveMessage()) .Returns(getProcessStartInfoMessage) .Returns(sessionEnd); - + // Act. this.designModeClient.ConnectToClientAndProcessRequests(0, this.mockTestRequestManager.Object); @@ -458,7 +458,7 @@ public void DesignModeClientConnectShouldSendTestMessageAndExecutionCompleteOnTe public void DesignModeClientSendTestMessageShouldSendTestMessage() { var testPayload = new TestMessagePayload { MessageLevel = ObjectModel.Logging.TestMessageLevel.Error, Message = "DummyMessage" }; - + this.designModeClient.SendTestMessage(testPayload.MessageLevel, testPayload.Message); this.mockCommunicationManager.Verify(cm => cm.SendMessage(MessageType.TestMessage, It.IsAny()), Times.Once()); diff --git a/test/Microsoft.TestPlatform.Client.UnitTests/DesignMode/DesignModeTestHostLauncherFactoryTests.cs b/test/Microsoft.TestPlatform.Client.UnitTests/DesignMode/DesignModeTestHostLauncherFactoryTests.cs index d4119e083c..b0dbf5b47a 100644 --- a/test/Microsoft.TestPlatform.Client.UnitTests/DesignMode/DesignModeTestHostLauncherFactoryTests.cs +++ b/test/Microsoft.TestPlatform.Client.UnitTests/DesignMode/DesignModeTestHostLauncherFactoryTests.cs @@ -19,7 +19,7 @@ public void DesignModeTestHostFactoryShouldReturnNonDebugLauncherIfDebuggingDisa var mockDesignModeClient = new Mock(); var testRunRequestPayload = new TestRunRequestPayload { DebuggingEnabled = false }; var launcher = DesignModeTestHostLauncherFactory.GetCustomHostLauncherForTestRun(mockDesignModeClient.Object, testRunRequestPayload); - + Assert.IsFalse(launcher.IsDebug, "Factory must not return debug launcher if debugging is disabled."); } diff --git a/test/Microsoft.TestPlatform.Client.UnitTests/Program.cs b/test/Microsoft.TestPlatform.Client.UnitTests/Program.cs index 60c2a31e7c..220caa36c3 100644 --- a/test/Microsoft.TestPlatform.Client.UnitTests/Program.cs +++ b/test/Microsoft.TestPlatform.Client.UnitTests/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. namespace Microsoft.VisualStudio.TestPlatform.Client.UnitTests -{ +{ public static class Program { public static void Main(string[] args) diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/TestPluginManagerTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/TestPluginManagerTests.cs index bdf0a004a2..fc7c5f26cd 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/TestPluginManagerTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/TestPluginManagerTests.cs @@ -130,7 +130,7 @@ public void GetTestExtensionsForAnExtensionAssemblyShouldReturnExtensionsInThatA Assert.IsTrue(testExtensions.Count() > 0); } - #region implementations + #region Implementations private abstract class AbstractDummyLogger : ITestLogger { diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/LazyExtensionTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/LazyExtensionTests.cs index e4a3dc41a7..c4eba8d2fd 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/LazyExtensionTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/LazyExtensionTests.cs @@ -80,7 +80,7 @@ public void MetadataShouldReturnMetadataSpecified() new LazyExtension( testDiscovererPluginInfo, mockMetadata.Object); - + Assert.AreEqual(mockMetadata.Object, extension.Metadata); } diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestDiscovererPluginInformationTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestDiscovererPluginInformationTests.cs index 1895ca3d4c..2ff6af44c3 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestDiscovererPluginInformationTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestDiscovererPluginInformationTests.cs @@ -17,7 +17,7 @@ namespace TestPlatform.Common.UnitTests.ExtensionFramework.Utilities public class TestDiscovererPluginInformationTests { private TestDiscovererPluginInformation testPluginInformation; - + [TestMethod] public void AssemblyQualifiedNameShouldReturnTestExtensionTypesName() { @@ -133,7 +133,7 @@ public void MetadataShouldReturnFileExtensionsAndDefaultExecutorUriAndAssemblyTy } #region Implementation - + public class DummyTestDiscovererWithNoFileExtensions { } diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestExtensionPluginInformationTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestExtensionPluginInformationTests.cs index 19f9865aa6..357f6c2f23 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestExtensionPluginInformationTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestExtensionPluginInformationTests.cs @@ -9,7 +9,7 @@ namespace TestPlatform.Common.UnitTests.ExtensionFramework.Utilities using Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.Utilities; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; - + [TestClass] public class TestExtensionPluginInformationTests { @@ -50,7 +50,7 @@ public void ExtensionUriShouldReturnExtensionUriOfAnExtension() public void MetadataShouldReturnExtensionUri() { this.testPluginInformation = new TestableTestExtensionPluginInformation(typeof(DummyTestExtensionWithExtensionUri)); - + CollectionAssert.AreEqual(new object[] { DefaultExtensionURI }, this.testPluginInformation.Metadata.ToArray()); } diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestPluginInformationTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestPluginInformationTests.cs index ccd12efab7..a6f46b535e 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestPluginInformationTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestPluginInformationTests.cs @@ -7,7 +7,7 @@ namespace TestPlatform.Common.UnitTests.ExtensionFramework.Utilities using System.Linq; using Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.Utilities; using Microsoft.VisualStudio.TestTools.UnitTesting; - + [TestClass] public class TestPluginInformationTests diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestSettingsProviderPluginInformationTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestSettingsProviderPluginInformationTests.cs index de47148a2f..c200738a70 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestSettingsProviderPluginInformationTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestSettingsProviderPluginInformationTests.cs @@ -53,7 +53,7 @@ public void SettingsNameShouldReturnExtensionUriOfAnExtension() Assert.AreEqual(DefaultSettingsName, this.testPluginInformation.SettingsName); } - #region implementation + #region Implementation private class DummySettingProviderWithoutSettingsName { diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/Filtering/TestCaseFilterExpressionTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/Filtering/TestCaseFilterExpressionTests.cs index e78e53c89f..521ea6a9a0 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/Filtering/TestCaseFilterExpressionTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/Filtering/TestCaseFilterExpressionTests.cs @@ -25,6 +25,6 @@ public void ValidForPropertiesShouldNotSetvalidForMatchVariableTofalseIfFilterIs bool result = testCaseFilterExpression.MatchTestCase(dummyTestCase, (s) => { return "unused"; }); Assert.IsTrue(result); - } + } } } diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/Logging/InternalTestLoggerEventsTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/Logging/InternalTestLoggerEventsTests.cs index c62a014c24..072c7c8c29 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/Logging/InternalTestLoggerEventsTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/Logging/InternalTestLoggerEventsTests.cs @@ -266,7 +266,7 @@ public void RaiseDiscoveryStartShouldThrowExceptionIfNullDiscoveryStartEventArgs }); } - /// + /// /// Exception should be thrown if discovered tests event args is null. /// [TestMethod] diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/Program.cs b/test/Microsoft.TestPlatform.Common.UnitTests/Program.cs index e50a487da0..c14da13e69 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/Program.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. namespace Microsoft.VisualStudio.TestPlatform.Common.UnitTests -{ +{ public static class Program { public static void Main(string[] args) diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/RunSettingsTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/RunSettingsTests.cs index 08f7a3eadf..adec8d5fe7 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/RunSettingsTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/RunSettingsTests.cs @@ -51,7 +51,7 @@ public void LoadSettingsXmlShoulLoadAndInitializeSettingsXml() runSettings.LoadSettingsXml(emptyRunSettings); - // Not doing this because when we load the xmla nd write to string it converts it to a utf-16 format. + // Not doing this because when we load the xml and write to string it converts it to a utf-16 format. // So they do not exactly match. // Assert.AreEqual(emptyRunSettings, runSettings.SettingsXml); diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/SettingsProvider/SettingsProviderExtensionManagerTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/SettingsProvider/SettingsProviderExtensionManagerTests.cs index 9e4029eb2b..bc0889c21c 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/SettingsProvider/SettingsProviderExtensionManagerTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/SettingsProvider/SettingsProviderExtensionManagerTests.cs @@ -99,7 +99,7 @@ public void CreateShouldCacheDiscoveredExtensions() Assert.IsNotNull(extensionManager.SettingsProvidersMap); Assert.IsTrue(extensionManager.SettingsProvidersMap.Count > 0); } - + #endregion #region LoadAndInitialize tests diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/Utilities/FakesUtilitiesTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/Utilities/FakesUtilitiesTests.cs index 475eeeaf1a..dc862ac7d3 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/Utilities/FakesUtilitiesTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/Utilities/FakesUtilitiesTests.cs @@ -10,7 +10,7 @@ namespace TestPlatform.Common.UnitTests.Utilities [TestClass] public class FakesUtilitiesTests { - + [TestMethod] public void FakesSettingsShouldBeNotGeneratedIfTargetFrameWorkIsNetCore() { diff --git a/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Utilities/JobQueueTests.cs b/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Utilities/JobQueueTests.cs index af62dd0475..27ad4895c0 100644 --- a/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Utilities/JobQueueTests.cs +++ b/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Utilities/JobQueueTests.cs @@ -166,7 +166,7 @@ public void OncePausedNoFurtherJobsAreProcessedUntilResumeIsCalled() processedJobs.Add(job); }; - // Queue the jobs after paused and verify they are not procesed until resumed. + // Queue the jobs after paused and verify they are not processed until resumed. using (var queue = new JobQueue(processHandler, "dp", int.MaxValue, int.MaxValue, false, (message) => { })) { queue.Pause(); @@ -266,16 +266,16 @@ public void TestBlockAtEnqueueDueToLength() Assert.IsTrue(queue.IsEnqueueBlocked, "Did not enter the over-ridden blocking method"); - // We wait till all jobs are finished, so that for the next iteration the queue is in a deterministic state. + // We wait till all jobs are finished, so that for the next iteration the queue is in a deterministic state. jobProcessed.WaitOne(); - // queue.enteredBlockingMethod is set to false to check it again in next iteration. Also + // queue.enteredBlockingMethod is set to false to check it again in next iteration. Also // allowJobProcessingHandlerToProceed is reset to block the handler again in next iteration. queue.IsEnqueueBlocked = false; allowJobProcessingHandlerToProceed.Reset(); // if we reach here it means that the queue was successfully blocked at some point in between job6 and job11 - // and subsequently unblocked. + // and subsequently unblocked. } } } @@ -308,7 +308,7 @@ public void TestBlockAtEnqueueDueToSize() queue.QueueJob("job4", 8); queue.QueueJob("job5", 8); - // At this point exactly 80 bytes have been queued. Even if all are still in queue, still the need to block shouldn't + // At this point exactly 80 bytes have been queued. Even if all are still in queue, still the need to block shouldn't // have risen. So queue.enteredBlockingMethod would be false. Assert.IsFalse(queue.IsEnqueueBlocked, "Entered the over-ridden blocking method at a wrong time."); @@ -325,13 +325,13 @@ public void TestBlockAtEnqueueDueToSize() // We wait till all jobs are finished, so that for the next iteration the queue is in a deterministic state. jobProcessed.WaitOne(); - // queue.enteredBlockingMethod is set to false to check it again in next iteration. Also + // queue.enteredBlockingMethod is set to false to check it again in next iteration. Also // allowJobProcessingHandlerToProceed is reset to block the handler again in next iteration. queue.IsEnqueueBlocked = false; allowJobProcessingHandlerToProceed.Reset(); // if we reach here it means that the queue was successfully blocked at some point in between job6 and job11 - // and subsequently unblocked. + // and subsequently unblocked. } } } @@ -375,10 +375,10 @@ public void TestBlockingDisabled() // allow handlers to proceed. allowJobProcessingHandlerToProceed.Set(); - // We wait till all jobs are finished, so that for the next iteration the queue is in a deterministic state. + // We wait till all jobs are finished, so that for the next iteration the queue is in a deterministic state. jobProcessed.WaitOne(); - // queue.enteredBlockingMethod is set to false to check it again in next iteration. Also + // queue.enteredBlockingMethod is set to false to check it again in next iteration. Also // allowJobProcessingHandlerToProceed is reset to allow blocking the handler again in next iteration. queue.IsEnqueueBlocked = false; allowJobProcessingHandlerToProceed.Reset(); @@ -389,7 +389,6 @@ public void TestBlockingDisabled() } [TestMethod] - public void TestLargeTestResultCanBeLoadedWithBlockingEnabled() { var jobProcessed = new AutoResetEvent(false); @@ -419,7 +418,6 @@ public void TestLargeTestResultCanBeLoadedWithBlockingEnabled() [TestMethod] - [Timeout(60000)] public void TestDisposeUnblocksBlockedThreads() { @@ -461,7 +459,7 @@ public void TestDisposeUnblocksBlockedThreads() #region Implementation /// - /// a class that inherits from job queue and over rides the WaitForQueueToEmpty to allow for checking that blocking and + /// a class that inherits from job queue and over rides the WaitForQueueToEmpty to allow for checking that blocking and /// unblocking work as expected. /// internal class JobQueueWrapper : JobQueue @@ -485,7 +483,7 @@ protected override bool WaitForQueueToGetEmpty() } /// - /// Specifies whether enQueue was blocked or not. + /// Specifies whether enQueue was blocked or not. /// public bool IsEnqueueBlocked { diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Adapter/TestExecutionRecorderTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Adapter/TestExecutionRecorderTests.cs index 891f7d4a87..1754bf621d 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Adapter/TestExecutionRecorderTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Adapter/TestExecutionRecorderTests.cs @@ -146,7 +146,7 @@ public void RecordEndShouldNotInvokeTestCaseEndEventInCaseOfAMissingTestCaseStar this.mockTestCaseEventsHandler.Verify(x => x.SendTestCaseEnd(this.testCase, TestOutcome.Passed), Times.Once); this.mockTestCaseEventsHandler.Verify(x => x.SendTestCaseEnd(this.testCase, TestOutcome.Failed), Times.Never); } - + [TestMethod] public void RecordEndShouldInvokeSendTestCaseEndMultipleTimesInDataDrivenScenario() { diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelDiscoveryEventsHandlerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelDiscoveryEventsHandlerTests.cs index 2ab42424a9..4ba1536d27 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelDiscoveryEventsHandlerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelDiscoveryEventsHandlerTests.cs @@ -47,7 +47,7 @@ public void TestInit() this.mockTestDiscoveryEventsHandler.Object, this.mockParallelProxyDiscoveryManager.Object, new ParallelDiscoveryDataAggregator(), this.mockDataSerializer.Object); } - + [TestMethod] public void HandleDiscoveryCompleteShouldNotCallLastChunkResultsIfNotPresent() { @@ -87,7 +87,7 @@ public void HandleDiscoveryCompleteShouldCallLastChunkResultsIfPresent() this.parallelDiscoveryEventsHandler.HandleDiscoveryComplete(discoveryCompleteEventsArgs, lastChunk); - // Raw message must be sent + // Raw message must be sent this.mockTestDiscoveryEventsHandler.Verify(mt => mt.HandleRawMessage(payload), Times.Once); this.mockTestDiscoveryEventsHandler.Verify(mt => mt.HandleDiscoveredTests(lastChunk), Times.Once); diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelOperationManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelOperationManagerTests.cs index da218fd1f3..587cdcbe50 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelOperationManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelOperationManagerTests.cs @@ -154,7 +154,7 @@ public void UpdateHandlerForManagerShouldUpdateHandlerForGivenManager() private class MockParallelOperationManager : ParallelOperationManager { - public MockParallelOperationManager(Func createNewClient, int parallelLevel, bool sharedHosts) : + public MockParallelOperationManager(Func createNewClient, int parallelLevel, bool sharedHosts) : base(createNewClient, parallelLevel, sharedHosts) { } diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyExecutionManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyExecutionManagerTests.cs index 6392dc7394..9a7a439a80 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyExecutionManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyExecutionManagerTests.cs @@ -467,7 +467,7 @@ private static void AssertMissingAndDuplicateTestCases(List tests, Lis if (processedTest.FullyQualifiedName.Equals(test.FullyQualifiedName)) { if (matchFound) - Assert.Fail("Concurrreny issue detected: Test['{0}'] got processed twice", test.FullyQualifiedName); + Assert.Fail("Concurrency issue detected: Test['{0}'] got processed twice", test.FullyQualifiedName); matchFound = true; } } @@ -494,7 +494,7 @@ private void SetupMockManagersForTestCase(List processedTestCases, Tes Task.Delay(100).Wait(); // Duplicated testRunCriteria should match the actual one. - Assert.AreEqual(testRunCriteria, criteria, "Mismastch in testRunCriteria"); + Assert.AreEqual(testRunCriteria, criteria, "Mismatch in testRunCriteria"); handler.HandleTestRunComplete(CreateTestRunCompleteArgs(), null, null, null); }); } diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelRunEventsHandlerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelRunEventsHandlerTests.cs index 384a46e96d..11e65f0c84 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelRunEventsHandlerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelRunEventsHandlerTests.cs @@ -55,7 +55,7 @@ public void HandleRawMessageShouldSendStatsChangeRawMessageToRunEventsHandler() string payload = "RunStats"; this.mockDataSerializer.Setup(mds => mds.DeserializeMessage(It.IsAny())) .Returns(new Message() { MessageType = MessageType.TestRunStatsChange, Payload = payload }); - + this.parallelRunEventsHandler.HandleRawMessage(payload); this.mockTestRunEventsHandler.Verify(mt => mt.HandleRawMessage(payload), Times.Once); @@ -91,7 +91,7 @@ public void HandleLogMessageShouldJustPassOnTheEventToRunEventsHandler() string log = "Hello"; this.parallelRunEventsHandler.HandleLogMessage(TestMessageLevel.Error, log); - this.mockTestRunEventsHandler.Verify(mt => + this.mockTestRunEventsHandler.Verify(mt => mt.HandleLogMessage(TestMessageLevel.Error, log), Times.Once); } @@ -123,7 +123,7 @@ public void HandleRunCompleteShouldNotCallLastChunkResultsIfNotPresent() this.parallelRunEventsHandler.HandleTestRunComplete(completeArgs, null, null, null); - // Raw message must be sent + // Raw message must be sent this.mockTestRunEventsHandler.Verify(mt => mt.HandleRawMessage(It.IsAny()), Times.Never); this.mockTestRunEventsHandler.Verify(mt => mt.HandleTestRunStatsChange(null), Times.Never); @@ -147,7 +147,7 @@ public void HandleRunCompleteShouldCallLastChunkResultsIfPresent() this.parallelRunEventsHandler.HandleTestRunComplete(completeArgs, lastChunk, null, null); - // Raw message must be sent + // Raw message must be sent this.mockTestRunEventsHandler.Verify(mt => mt.HandleRawMessage(payload), Times.Once); this.mockTestRunEventsHandler.Verify(mt => mt.HandleTestRunStatsChange(lastChunk), Times.Once); @@ -178,7 +178,7 @@ public void HandleRunCompleteShouldCallTestRunCompleteOnActualHandlerIfParallelM this.mockTestRunEventsHandler.Verify(mt => mt.HandleTestRunComplete( It.IsAny(), - It.IsAny(), + It.IsAny(), It.IsAny>(), It.IsAny>()), Times.Once); } diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyDiscoveryManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyDiscoveryManagerTests.cs index e10c7c7c60..c8a79638c2 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyDiscoveryManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyDiscoveryManagerTests.cs @@ -250,8 +250,8 @@ public void DiscoverTestsShouldQueryTestHostManagerForExtensions() [TestMethod] public void DiscoverTestsShouldPassAdapterToTestHostManagerFromTestPluginCacheExtensions() { - // We are updating extension with testadapter only to make it easy to test. - // In product code it filter out testadapter from extension + // We are updating extension with test adapter only to make it easy to test. + // In product code it filter out test adapter from extension TestPluginCache.Instance.UpdateExtensions(new List { "abc.TestAdapter.dll", "xyz.TestAdapter.dll" }, false); try { diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectionExtensionManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectionExtensionManagerTests.cs index 967bda7be6..70e5a8ce85 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectionExtensionManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectionExtensionManagerTests.cs @@ -200,7 +200,7 @@ public void TriggerSessionStartShouldBeCalledWithCorrectTestSources() { var properties = new Dictionary(); properties.Add("TestSources", new List() { "testsource1.dll", "testsource2.dll" }); - + var mockDataCollector = inProcDataCollectionManager.InProcDataCollectors.Values.FirstOrDefault() as MockDataCollector; this.mockTestEventsPublisher.Raise(x => x.SessionStart += null, new SessionStartEventArgs(properties)); diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectionSinkTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectionSinkTests.cs index 1ff74ce5c6..ccb112b882 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectionSinkTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectionSinkTests.cs @@ -62,7 +62,7 @@ public void SendDataShouldThrowArgumentExceptionIfValueIsNull() } //[TestMethod] - // TODO : Currently this code hits when test case id is null for core projects. For that we don't have algorithm to generate the guid. It's not implemented exception now (Source Code : EqtHash.cs). + // TODO : Currently this code hits when test case id is null for core projects. For that we don't have algorithm to generate the guid. It's not implemented exception now (Source Code : EqtHash.cs). public void SendDataShouldThrowArgumentExceptionIfTestCaseIdIsNull() { Assert.ThrowsException( diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscoveryManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscoveryManagerTests.cs index fd01fbd8ce..44b402f182 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscoveryManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscoveryManagerTests.cs @@ -238,7 +238,7 @@ public void DiscoveryInitializeShouldVerifyWarningMessageIfAdapterFailedToLoad() //Act this.discoveryManager.Initialize(new List { assemblyLocation }, mockLogger.Object); - //when handler instance returns warning + //when handler instance returns warning sessionLogger.SendMessage(TestMessageLevel.Warning, "verify that the HandleLogMessage method getting invoked at least once"); // Verify. diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscoveryResultCacheTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscoveryResultCacheTests.cs index 1b6635ad3f..06b907f708 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscoveryResultCacheTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscoveryResultCacheTests.cs @@ -29,7 +29,7 @@ public void DiscoveryResultCacheConstructorShouldInitializeDiscoveredTestsList() public void DiscoveryResultCacheConstructorShouldInitializeTotalDiscoveredTests() { var cache = new DiscoveryResultCache(1000, TimeSpan.FromHours(1), (tests) => { }); - + Assert.AreEqual(0, cache.TotalDiscoveredTests); } diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/TestCaseDiscoverySinkTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/TestCaseDiscoverySinkTests.cs index 01ed212ee3..417977fc22 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/TestCaseDiscoverySinkTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/TestCaseDiscoverySinkTests.cs @@ -32,7 +32,7 @@ public void SendTestCaseShouldSendTestCasesToCache() var sink = new TestCaseDiscoverySink(cache); var testCase = new TestCase("A.C.M", new Uri("executor://unittest"), "A"); - + sink.SendTestCase(testCase); // Assert that the cache has the test case. diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/ExecutionManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/ExecutionManagerTests.cs index 8424a56775..596f2676b8 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/ExecutionManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/ExecutionManagerTests.cs @@ -223,9 +223,9 @@ public void StartTestRunShouldAbortTheRunIfAnyExceptionComesForTheProvidedSource // new string[] { assemblyLocation }, // () => { }); // //Act - // this.executionManager.Initialize(new List { assemblyLocation }, mockLogger.Object); + // this.executionManager.Initialize(new List { assemblyLocation }, mockLogger.Object); - // //when handler instance returns warning + // //when handler instance returns warning // sessionLogger.SendMessage(TestMessageLevel.Warning, "verify that it is downgraded to warning"); // // Verify. diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithSourcesTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithSourcesTests.cs index e0428af564..40d551968d 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithSourcesTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithSourcesTests.cs @@ -325,13 +325,13 @@ private void SetupForNoTestsAvailable(string testCaseFilter, out string sourcesS private class TestableRunTestsWithSources : RunTestsWithSources { - public TestableRunTestsWithSources(Dictionary> adapterSourceMap, string runSettings, + public TestableRunTestsWithSources(Dictionary> adapterSourceMap, string runSettings, TestExecutionContext testExecutionContext, ITestCaseEventsHandler testCaseEventsHandler, ITestRunEventsHandler testRunEventsHandler, IRequestData requestData) : base(requestData, adapterSourceMap, null, runSettings, testExecutionContext, testCaseEventsHandler, testRunEventsHandler) { } - internal TestableRunTestsWithSources(Dictionary> adapterSourceMap, string runSettings, + internal TestableRunTestsWithSources(Dictionary> adapterSourceMap, string runSettings, TestExecutionContext testExecutionContext, ITestCaseEventsHandler testCaseEventsHandler, ITestRunEventsHandler testRunEventsHandler, Dictionary, IEnumerable> executorUriVsSourceList, IRequestData requestData) : base(requestData, adapterSourceMap, null, runSettings, testExecutionContext, testCaseEventsHandler, testRunEventsHandler, executorUriVsSourceList) diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithTestsTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithTestsTests.cs index 33f1402765..c8cf6f182b 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithTestsTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/RunTestsWithTestsTests.cs @@ -121,7 +121,7 @@ public void InvokeExecutorShouldInvokeTestExecutorWithTheTests() { new TestCase("A.C.M1", new Uri("e://d"), "s.dll") }; - + var executorUriVsTestList = new Dictionary, List>(); var executorUriExtensionTuple = new Tuple(new Uri("e://d/"), "A.dll"); executorUriVsTestList.Add(executorUriExtensionTuple, tests); @@ -134,7 +134,7 @@ public void InvokeExecutorShouldInvokeTestExecutorWithTheTests() this.mockTestRunEventsHandler.Object, executorUriVsTestList, this.mockRequestData.Object); - + var testExecutor = new RunTestsWithSourcesTests.RunTestWithSourcesExecutor(); var extension = new LazyExtension(testExecutor, new TestExecutorMetadata("e://d/")); IEnumerable receivedTests = null; diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/TestRunCacheTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/TestRunCacheTests.cs index 09e1ce4b15..5174551fa3 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/TestRunCacheTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Execution/TestRunCacheTests.cs @@ -325,7 +325,7 @@ public void GetLastChunkShouldResetTestResultsInCache() var tester = new TestCacheTester { ExpectedCacheSize = cacheSize }; var cache = new TestRunCache(cacheSize, TimeSpan.MaxValue, tester.CacheHitOnSize); - + for (var i = 0; i < 2; i++) { var tr = this.GetTestResult(i); diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Program.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Program.cs index 34f4b78032..939e1bde54 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Program.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.UnitTests -{ +{ public static class Program { public static void Main(string[] args) diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/TestLoggerManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/TestLoggerManagerTests.cs index 2e2865af26..ba480637db 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/TestLoggerManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/TestLoggerManagerTests.cs @@ -76,14 +76,14 @@ public void GetResultsDirectoryShouldReturnNullIfRunSettingsIsNull() [TestMethod] public void GetResultsDirectoryShouldReadResultsDirectoryFromSettingsIfSpecified() { - string runSettingsXml = @" - - + string runSettingsXml = @" + + 0 - DummyTestResultsFolder - x64 - Framework45 - + DummyTestResultsFolder + x64 + Framework45 + "; var testLoggerManager = new DummyTestLoggerManager(); @@ -94,13 +94,13 @@ public void GetResultsDirectoryShouldReadResultsDirectoryFromSettingsIfSpecified [TestMethod] public void GetResultsDirectoryShouldReturnDefaultPathIfResultsDirectoryIsNotProvidedInRunSettings() { - string runSettingsXml = @" - - - 0 - x64 - Framework45 - + string runSettingsXml = @" + + + 0 + x64 + Framework45 + "; var testLoggerManager = new DummyTestLoggerManager(); @@ -112,13 +112,13 @@ public void GetResultsDirectoryShouldReturnDefaultPathIfResultsDirectoryIsNotPro [TestMethod] public void GetTargetFrameworkShouldReturnFrameworkProvidedInRunSettings() { - string runSettingsXml = @" - - - 0 - x64 - Framework45 - + string runSettingsXml = @" + + + 0 + x64 + Framework45 + "; var testLoggerManager = new DummyTestLoggerManager(); @@ -135,7 +135,7 @@ public void HandleTestRunMessageShouldInvokeTestRunMessageHandlerOfLoggers() var testLoggerManager = new DummyTestLoggerManager(); testLoggerManager.InitializeLoggerByUri(new Uri(loggerUri), new Dictionary()); testLoggerManager.EnableLogging(); - + testLoggerManager.HandleTestRunMessage(new TestRunMessageEventArgs(TestMessageLevel.Informational, "TestRunMessage")); waitHandle.WaitOne(); @@ -1086,7 +1086,7 @@ public void InitializeShouldPassConfigurationElementAsParameters() Assert.AreEqual(4, ValidLoggerWithParameters.parameters.Count); // Two additional because of testRunDirectory and targetFramework Assert.AreEqual("Value1", ValidLoggerWithParameters.parameters["Key1"]); Assert.AreEqual("Value2", ValidLoggerWithParameters.parameters["Key2"]); - + mockMetricsCollection.Verify( rd => rd.Add(TelemetryDataConstants.LoggerUsed, "TestPlatform.CrossPlatEngine.UnitTests.TestLoggerManagerTests+ValidLogger,TestPlatform.CrossPlatEngine.UnitTests.TestLoggerManagerTests+ValidLogger2,TestPlatform.CrossPlatEngine.UnitTests.TestLoggerManagerTests+ValidLoggerWithParameters")); } diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/TestableImplementations/TestableTestRunCache.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/TestableImplementations/TestableTestRunCache.cs index c4a7198780..e2ca5ab58d 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/TestableImplementations/TestableTestRunCache.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/TestableImplementations/TestableTestRunCache.cs @@ -17,7 +17,7 @@ public TestableTestRunCache() this.TestCompletedList = new List(); this.TestResultList = new List(); } - + // use the below three to fill in data to the testable cache. public List TestStartedList { get; private set; } diff --git a/test/Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests/Program.cs b/test/Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests/Program.cs index e527ace39f..7642a15003 100644 --- a/test/Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests/Program.cs +++ b/test/Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. namespace Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests -{ +{ public static class Program { public static void Main(string[] args) diff --git a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Client/TestRunCriteriaTests.cs b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Client/TestRunCriteriaTests.cs index 33eb6ec1fe..b6d50cc2b0 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Client/TestRunCriteriaTests.cs +++ b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Client/TestRunCriteriaTests.cs @@ -83,7 +83,7 @@ public void SourcesShouldReturnNullIfAdapterSourceMapIsNull() new TestRunCriteria( new List { new TestCase("A.C.M", new Uri("excutor://dummy"), "s.dll") }, frequencyOfRunStatsChangeEvent: 10); - + Assert.IsNull(testRunCriteria.Sources); } diff --git a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/CustomStringArrayConverterTests.cs b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/CustomStringArrayConverterTests.cs index a20dedc10c..4d7ba84140 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/CustomStringArrayConverterTests.cs +++ b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/CustomStringArrayConverterTests.cs @@ -68,7 +68,6 @@ public void CustomStringArrayConverterShouldDeserializeEmptyKeyOrValue() Assert.AreEqual(string.Empty, data[1]); } - [TestMethod] public void CustomStringArrayConverterShouldDeserializeNullValue() { diff --git a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Program.cs b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Program.cs index 9e66580f58..ac2135a417 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Program.cs +++ b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. namespace Microsoft.TestPlatform.ObjectModel.UnitTests -{ +{ public static class Program { public static void Main(string[] args) diff --git a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/RunSettings/RunConfigurationTests.cs b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/RunSettings/RunConfigurationTests.cs index 1f2b96daa9..d03d72f3a8 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/RunSettings/RunConfigurationTests.cs +++ b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/RunSettings/RunConfigurationTests.cs @@ -146,7 +146,7 @@ public void SetTargetFrameworkShouldSetTargetFrameworkVersion() var runConfiguration = new RunConfiguration(); #pragma warning disable 612, 618 - + runConfiguration.TargetFramework = Framework.FromString("Framework35"); Assert.AreEqual(FrameworkVersion.Framework35, runConfiguration.TargetFrameworkVersion); @@ -176,7 +176,7 @@ public void RunConfigurationFromXmlThrowsSettingsExceptionIfBatchSizeIsInvalid() "; - + Assert.That.Throws( () => XmlRunSettingsUtilities.GetRunConfigurationNode(settingsXml)) .WithExactMessage("Invalid settings 'RunConfiguration'. Invalid value 'Foo' specified for 'BatchSize'."); @@ -277,7 +277,7 @@ public void RunConfigurationShouldSetDesignModeAsFalseByDefault() "; var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(settingsXml); - + Assert.IsFalse(runConfiguration.DesignMode); } @@ -319,7 +319,7 @@ public void RunConfigurationShouldSetCollectSourceInformationSameAsDesignModeByD "; var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(settingsXml); - + Assert.AreEqual(runConfiguration.DesignMode, runConfiguration.ShouldCollectSourceInformation); } diff --git a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/TestCaseTests.cs b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/TestCaseTests.cs index 4923d4898a..f61dfcd2d7 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/TestCaseTests.cs +++ b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/TestCaseTests.cs @@ -80,7 +80,7 @@ public void TestCaseGetPropertyValueForDisplayNameShouldReturnCorrectValue() Assert.AreEqual(testDisplayName, this.testCase.GetPropertyValue(TestCaseProperties.DisplayName)); } - + [TestMethod] public void TestCaseGetPropertyValueForExecutorUriShouldReturnCorrectValue() { @@ -89,7 +89,7 @@ public void TestCaseGetPropertyValueForExecutorUriShouldReturnCorrectValue() Assert.AreEqual(testExecutorUri, this.testCase.GetPropertyValue(TestCaseProperties.ExecutorUri)); } - + [TestMethod] public void TestCaseGetPropertyValueForFullyQualifiedNameShouldReturnCorrectValue() { @@ -98,7 +98,7 @@ public void TestCaseGetPropertyValueForFullyQualifiedNameShouldReturnCorrectValu Assert.AreEqual(testFullyQualifiedName, this.testCase.GetPropertyValue(TestCaseProperties.FullyQualifiedName)); } - + [TestMethod] public void TestCaseGetPropertyValueForIdShouldReturnCorrectValue() { diff --git a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Utilities/FilterHelperTests.cs b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Utilities/FilterHelperTests.cs index e7dbe42ef8..a6a9e2b452 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Utilities/FilterHelperTests.cs +++ b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Utilities/FilterHelperTests.cs @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.TestPlatform.ObjectModel.UnitTests.Utilities { @@ -7,7 +7,7 @@ namespace Microsoft.TestPlatform.ObjectModel.UnitTests.Utilities using System.Globalization; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Resources; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; - using Microsoft.VisualStudio.TestTools.UnitTesting; + using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] public class FilterHelpersTests diff --git a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Utilities/XmlRunSettingsUtilitiesTests.cs b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Utilities/XmlRunSettingsUtilitiesTests.cs index f75beb8913..ede09f8c76 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Utilities/XmlRunSettingsUtilitiesTests.cs +++ b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/Utilities/XmlRunSettingsUtilitiesTests.cs @@ -967,7 +967,7 @@ public void GetLoggerRunSettingsShouldThrowWhenNodeOtherThanConfigurationPresent { exceptionMessage = ex.Message; } - + Assert.AreEqual(string.Format( Resources.InvalidSettingsXmlElement, "Logger", diff --git a/test/Microsoft.TestPlatform.PerformanceTests/Program.cs b/test/Microsoft.TestPlatform.PerformanceTests/Program.cs index a68294ce79..f51a7b7fe2 100644 --- a/test/Microsoft.TestPlatform.PerformanceTests/Program.cs +++ b/test/Microsoft.TestPlatform.PerformanceTests/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. namespace testhost.UnitTests -{ +{ public static class Program { public static void Main(string[] args) diff --git a/test/Microsoft.TestPlatform.PerformanceTests/ProtocolV2Tests.cs b/test/Microsoft.TestPlatform.PerformanceTests/ProtocolV2Tests.cs index 6f677eb873..4e2ca53d51 100644 --- a/test/Microsoft.TestPlatform.PerformanceTests/ProtocolV2Tests.cs +++ b/test/Microsoft.TestPlatform.PerformanceTests/ProtocolV2Tests.cs @@ -42,7 +42,7 @@ public class ProtocolV2Tests StartTime = startTime, EndTime = DateTimeOffset.MaxValue }; - + [TestMethod] public void TestCaseSerialize2() { @@ -56,7 +56,7 @@ public void TestCaseSerialize2() VerifyPerformanceResult("TestCaseSerialize2", 2000, sw.ElapsedMilliseconds); } - + [TestMethod] public void TestCaseDeserialize2() { @@ -72,7 +72,7 @@ public void TestCaseDeserialize2() VerifyPerformanceResult("TestCaseDeserialize2", 2000, sw.ElapsedMilliseconds); } - + [TestMethod] public void TestResultSerialize2() { @@ -86,7 +86,7 @@ public void TestResultSerialize2() VerifyPerformanceResult("TestResultSerialize2", 2000, sw.ElapsedMilliseconds); } - + [TestMethod] public void TestResultDeserialize2() { diff --git a/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/DiscoveryPerfTests.cs b/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/DiscoveryPerfTests.cs index 3f08014b49..ca2c0cdf9a 100644 --- a/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/DiscoveryPerfTests.cs +++ b/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/DiscoveryPerfTests.cs @@ -13,7 +13,7 @@ public class DiscoveryPerfTests : TelemetryPerfTestbase { private IVsTestConsoleWrapper vstestConsoleWrapper; private DiscoveryEventHandler2 discoveryEventHandler2; - + public DiscoveryPerfTests() { this.vstestConsoleWrapper = this.GetVsTestConsoleWrapper(); diff --git a/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/EventHandler/DiscoveryEventHandler.cs b/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/EventHandler/DiscoveryEventHandler.cs index 8c5b8ba1a5..ffccb55529 100644 --- a/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/EventHandler/DiscoveryEventHandler.cs +++ b/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/EventHandler/DiscoveryEventHandler.cs @@ -55,4 +55,3 @@ public void HandleDiscoveredTests(IEnumerable discoveredTestCases) } } } - diff --git a/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/TelemetryPerfTestBase.cs b/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/TelemetryPerfTestBase.cs index 65f882b653..3f2dd5b6a2 100644 --- a/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/TelemetryPerfTestBase.cs +++ b/test/Microsoft.TestPlatform.PerformanceTests/TranslationLayer/TelemetryPerfTestBase.cs @@ -19,7 +19,7 @@ public class TelemetryPerfTestbase private const string TelemetryInstrumentationKey = "76b373ba-8a55-45dd-b6db-7f1a83288691"; private TelemetryClient client; private DirectoryInfo currentDirectory = new DirectoryInfo(typeof(DiscoveryPerfTests).GetTypeInfo().Assembly.GetAssemblyLocation()).Parent; - + public TelemetryPerfTestbase() { client = new TelemetryClient(); diff --git a/test/Microsoft.TestPlatform.SmokeTests/Program.cs b/test/Microsoft.TestPlatform.SmokeTests/Program.cs index a68294ce79..f51a7b7fe2 100644 --- a/test/Microsoft.TestPlatform.SmokeTests/Program.cs +++ b/test/Microsoft.TestPlatform.SmokeTests/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. namespace testhost.UnitTests -{ +{ public static class Program { public static void Main(string[] args) diff --git a/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs b/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs index bdd9cf9567..76d316bfc2 100644 --- a/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs +++ b/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs @@ -373,7 +373,7 @@ protected string GetProjectAssetFullPath(string projectName, string assetName) { var projectPath = this.testEnvironment.GetTestProject(projectName); return Path.Combine(Path.GetDirectoryName(projectPath), assetName); - } + } protected string GetTestAdapterPath(UnitTestFramework testFramework = UnitTestFramework.MSTest) { @@ -513,7 +513,7 @@ private void ExecuteVsTestConsole(string args, out string stdOut, out string std } /// - /// Executes a local copy of dotnet that has VSTest task installed and possibly other modifications. Do not use this to + /// Executes a local copy of dotnet that has VSTest task installed and possibly other modifications. Do not use this to /// do your builds or to run general tests, unless you want your changes to be reflected. /// /// @@ -524,9 +524,9 @@ private void ExecuteVsTestConsole(string args, out string stdOut, out string std private void ExecutePatchedDotnet(string command, string args, out string stdOut, out string stdError, out int exitCode) { var environmentVariables = new Dictionary { - ["DOTNET_MULTILEVEL_LOOKUP"] = "0" + ["DOTNET_MULTILEVEL_LOOKUP"] = "0" }; - + var patchedDotnetPath = Path.Combine(this.testEnvironment.TestArtifactsDirectory, @"dotnet\dotnet.exe"); ; this.ExecuteApplication(patchedDotnetPath, string.Join(" ", command, args), out stdOut, out stdError, out exitCode, environmentVariables); } @@ -556,7 +556,7 @@ private void ExecuteApplication(string path, string args, out string stdOut, out foreach (var variable in environmentVariables) { if (process.StartInfo.EnvironmentVariables.ContainsKey(variable.Key)) { process.StartInfo.EnvironmentVariables[variable.Key] = variable.Value; - } + } else { process.StartInfo.EnvironmentVariables.Add(variable.Key, variable.Value); diff --git a/test/Microsoft.TestPlatform.TestUtilities/PerfInstrumentation/PerformanceTestBase.cs b/test/Microsoft.TestPlatform.TestUtilities/PerfInstrumentation/PerformanceTestBase.cs index d08d473e4f..e514227e8a 100644 --- a/test/Microsoft.TestPlatform.TestUtilities/PerfInstrumentation/PerformanceTestBase.cs +++ b/test/Microsoft.TestPlatform.TestUtilities/PerfInstrumentation/PerformanceTestBase.cs @@ -6,7 +6,7 @@ namespace Microsoft.TestPlatform.TestUtilities.PerfInstrumentation using System.Collections; using System.Collections.Generic; - using Microsoft.TestPlatform.TestUtilities; + using Microsoft.TestPlatform.TestUtilities; /// /// The performance test base. diff --git a/test/Microsoft.TestPlatform.Utilities.UnitTests/InferRunSettingsHelperTests.cs b/test/Microsoft.TestPlatform.Utilities.UnitTests/InferRunSettingsHelperTests.cs index d2f11736ae..52016f886b 100644 --- a/test/Microsoft.TestPlatform.Utilities.UnitTests/InferRunSettingsHelperTests.cs +++ b/test/Microsoft.TestPlatform.Utilities.UnitTests/InferRunSettingsHelperTests.cs @@ -3,842 +3,842 @@ namespace Microsoft.TestPlatform.Utilities.UnitTests { - using System; - using System.Xml; - using System.Xml.XPath; - - using Microsoft.TestPlatform.Utilities.Tests; - using Microsoft.VisualStudio.TestPlatform.ObjectModel; - using OMResources = Microsoft.VisualStudio.TestPlatform.ObjectModel.Resources.CommonResources; - using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; - using Microsoft.VisualStudio.TestPlatform.Utilities; - using Microsoft.VisualStudio.TestTools.UnitTesting; - using MSTest.TestFramework.AssertExtensions; - using System.IO; - using System.Collections.Generic; - using System.Linq; - using UtilitiesResources = Microsoft.VisualStudio.TestPlatform.Utilities.Resources.Resources; - using System.Globalization; - using System.Text; - - [TestClass] - public class InferRunSettingsHelperTests - { - private IDictionary sourceArchitectures; - private IDictionary sourceFrameworks; - private readonly Framework frameworkNet45 = Framework.FromString(".NETFramework,Version=4.5"); - private readonly Framework frameworkNet46 = Framework.FromString(".NETFramework,Version=4.6"); - private readonly Framework frameworkNet47 = Framework.FromString(".NETFramework,Version=4.7"); - - public InferRunSettingsHelperTests() - { - sourceArchitectures = new Dictionary(); - sourceFrameworks = new Dictionary(); - } - - [TestMethod] - public void UpdateRunSettingsShouldThrowIfRunSettingsNodeDoesNotExist() - { - var settings = @""; - var xmlDocument = this.GetXmlDocument(settings); - - Action action = () => InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X86, Framework.DefaultFramework, "temp"); - - Assert.That.Throws(action) - .WithMessage(string.Format("An error occurred while loading the settings. Error: {0}.", - "Could not find 'RunSettings' node.")); - } - - [TestMethod] - public void UpdateRunSettingsShouldThrowIfPlatformNodeIsInvalid() - { - var settings = @"foo"; - var xmlDocument = this.GetXmlDocument(settings); - - Action action = () => InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X86, Framework.DefaultFramework, "temp"); - - Assert.That.Throws(action) - .WithMessage(string.Format("An error occurred while loading the settings. Error: {0}.", - string.Format("Invalid setting '{0}'. Invalid value '{1}' specified for '{2}'", - "RunConfiguration", - "foo", - "TargetPlatform"))); - } - - [TestMethod] - public void UpdateRunSettingsShouldThrowIfFrameworkNodeIsInvalid() - { - var settings = @"foo"; - var xmlDocument = this.GetXmlDocument(settings); - - Action action = () => InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X86, Framework.DefaultFramework, "temp"); - - Assert.That.Throws(action) - .WithMessage(string.Format("An error occurred while loading the settings. Error: {0}.", - string.Format("Invalid setting '{0}'. Invalid value '{1}' specified for '{2}'", - "RunConfiguration", - "foo", - "TargetFrameworkVersion"))); - } - - [TestMethod] - public void UpdateRunSettingsShouldUpdateWithPlatformSettings() - { - var settings = @""; - var xmlDocument = this.GetXmlDocument(settings); - - InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X86, Framework.DefaultFramework, "temp"); + using System; + using System.Xml; + using System.Xml.XPath; + + using Microsoft.TestPlatform.Utilities.Tests; + using Microsoft.VisualStudio.TestPlatform.ObjectModel; + using OMResources = Microsoft.VisualStudio.TestPlatform.ObjectModel.Resources.CommonResources; + using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; + using Microsoft.VisualStudio.TestPlatform.Utilities; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using MSTest.TestFramework.AssertExtensions; + using System.IO; + using System.Collections.Generic; + using System.Linq; + using UtilitiesResources = Microsoft.VisualStudio.TestPlatform.Utilities.Resources.Resources; + using System.Globalization; + using System.Text; + + [TestClass] + public class InferRunSettingsHelperTests + { + private IDictionary sourceArchitectures; + private IDictionary sourceFrameworks; + private readonly Framework frameworkNet45 = Framework.FromString(".NETFramework,Version=4.5"); + private readonly Framework frameworkNet46 = Framework.FromString(".NETFramework,Version=4.6"); + private readonly Framework frameworkNet47 = Framework.FromString(".NETFramework,Version=4.7"); + + public InferRunSettingsHelperTests() + { + sourceArchitectures = new Dictionary(); + sourceFrameworks = new Dictionary(); + } + + [TestMethod] + public void UpdateRunSettingsShouldThrowIfRunSettingsNodeDoesNotExist() + { + var settings = @""; + var xmlDocument = this.GetXmlDocument(settings); + + Action action = () => InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X86, Framework.DefaultFramework, "temp"); + + Assert.That.Throws(action) + .WithMessage(string.Format("An error occurred while loading the settings. Error: {0}.", + "Could not find 'RunSettings' node.")); + } + + [TestMethod] + public void UpdateRunSettingsShouldThrowIfPlatformNodeIsInvalid() + { + var settings = @"foo"; + var xmlDocument = this.GetXmlDocument(settings); + + Action action = () => InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X86, Framework.DefaultFramework, "temp"); + + Assert.That.Throws(action) + .WithMessage(string.Format("An error occurred while loading the settings. Error: {0}.", + string.Format("Invalid setting '{0}'. Invalid value '{1}' specified for '{2}'", + "RunConfiguration", + "foo", + "TargetPlatform"))); + } + + [TestMethod] + public void UpdateRunSettingsShouldThrowIfFrameworkNodeIsInvalid() + { + var settings = @"foo"; + var xmlDocument = this.GetXmlDocument(settings); + + Action action = () => InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X86, Framework.DefaultFramework, "temp"); + + Assert.That.Throws(action) + .WithMessage(string.Format("An error occurred while loading the settings. Error: {0}.", + string.Format("Invalid setting '{0}'. Invalid value '{1}' specified for '{2}'", + "RunConfiguration", + "foo", + "TargetFrameworkVersion"))); + } + + [TestMethod] + public void UpdateRunSettingsShouldUpdateWithPlatformSettings() + { + var settings = @""; + var xmlDocument = this.GetXmlDocument(settings); + + InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X86, Framework.DefaultFramework, "temp"); - var xml = xmlDocument.OuterXml; - - StringAssert.Contains(xml, "X86"); - } - - [TestMethod] - public void UpdateRunSettingsShouldUpdateWithFrameworkSettings() - { - var settings = @""; - var xmlDocument = this.GetXmlDocument(settings); + var xml = xmlDocument.OuterXml; + + StringAssert.Contains(xml, "X86"); + } + + [TestMethod] + public void UpdateRunSettingsShouldUpdateWithFrameworkSettings() + { + var settings = @""; + var xmlDocument = this.GetXmlDocument(settings); - InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X86, Framework.DefaultFramework, "temp"); + InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X86, Framework.DefaultFramework, "temp"); - var xml = xmlDocument.OuterXml; + var xml = xmlDocument.OuterXml; - StringAssert.Contains(xml, $"{Framework.DefaultFramework.Name}"); - } + StringAssert.Contains(xml, $"{Framework.DefaultFramework.Name}"); + } - [TestMethod] - public void UpdateRunSettingsShouldUpdateWithResultsDirectorySettings() - { - var settings = @""; - var xmlDocument = this.GetXmlDocument(settings); + [TestMethod] + public void UpdateRunSettingsShouldUpdateWithResultsDirectorySettings() + { + var settings = @""; + var xmlDocument = this.GetXmlDocument(settings); - InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X86, Framework.DefaultFramework, "temp"); + InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X86, Framework.DefaultFramework, "temp"); - var xml = xmlDocument.OuterXml; + var xml = xmlDocument.OuterXml; - StringAssert.Contains(xml, "temp"); - } + StringAssert.Contains(xml, "temp"); + } - [TestMethod] - public void UpdateRunSettingsShouldNotUpdatePlatformIfRunSettingsAlreadyHasIt() - { - var settings = @"X86"; - var xmlDocument = this.GetXmlDocument(settings); + [TestMethod] + public void UpdateRunSettingsShouldNotUpdatePlatformIfRunSettingsAlreadyHasIt() + { + var settings = @"X86"; + var xmlDocument = this.GetXmlDocument(settings); - InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); + InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); - var xml = xmlDocument.OuterXml; + var xml = xmlDocument.OuterXml; - StringAssert.Contains(xml, "X86"); - } + StringAssert.Contains(xml, "X86"); + } - [TestMethod] - public void UpdateRunSettingsShouldNotUpdateFrameworkIfRunSettingsAlreadyHasIt() - { - var settings = @"Framework40"; - var xmlDocument = this.GetXmlDocument(settings); + [TestMethod] + public void UpdateRunSettingsShouldNotUpdateFrameworkIfRunSettingsAlreadyHasIt() + { + var settings = @"Framework40"; + var xmlDocument = this.GetXmlDocument(settings); - InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); + InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); - var xml = xmlDocument.OuterXml; + var xml = xmlDocument.OuterXml; - StringAssert.Contains(xml, ".NETFramework,Version=v4.0"); - } - //TargetFrameworkMoniker + StringAssert.Contains(xml, ".NETFramework,Version=v4.0"); + } + //TargetFrameworkMoniker - [TestMethod] - public void UpdateRunSettingsShouldAllowTargetFrameworkMonikerValue() - { + [TestMethod] + public void UpdateRunSettingsShouldAllowTargetFrameworkMonikerValue() + { - var settings = @".NETFramework,Version=v4.0"; - var xmlDocument = this.GetXmlDocument(settings); + var settings = @".NETFramework,Version=v4.0"; + var xmlDocument = this.GetXmlDocument(settings); - InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); + InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); - var xml = xmlDocument.OuterXml; + var xml = xmlDocument.OuterXml; - StringAssert.Contains(xml, ".NETFramework,Version=v4.0"); - } + StringAssert.Contains(xml, ".NETFramework,Version=v4.0"); + } - [TestMethod] - public void UpdateRunSettingsShouldNotUpdateResultsDirectoryIfRunSettingsAlreadyHasIt() - { - var settings = @"someplace"; - var xmlDocument = this.GetXmlDocument(settings); + [TestMethod] + public void UpdateRunSettingsShouldNotUpdateResultsDirectoryIfRunSettingsAlreadyHasIt() + { + var settings = @"someplace"; + var xmlDocument = this.GetXmlDocument(settings); - InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); + InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); - var xml = xmlDocument.OuterXml; + var xml = xmlDocument.OuterXml; - StringAssert.Contains(xml, "someplace"); - } + StringAssert.Contains(xml, "someplace"); + } - [TestMethod] - public void UpdateRunSettingsShouldNotUpdatePlatformOrFrameworkOrResultsDirectoryIfRunSettingsAlreadyHasIt() - { - var settings = @"X86Framework40someplace"; - var xmlDocument = this.GetXmlDocument(settings); + [TestMethod] + public void UpdateRunSettingsShouldNotUpdatePlatformOrFrameworkOrResultsDirectoryIfRunSettingsAlreadyHasIt() + { + var settings = @"X86Framework40someplace"; + var xmlDocument = this.GetXmlDocument(settings); - InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); + InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); - var xml = xmlDocument.OuterXml; + var xml = xmlDocument.OuterXml; - StringAssert.Contains(xml, "X86"); - StringAssert.Contains(xml, "Framework40"); - StringAssert.Contains(xml, "someplace"); - } + StringAssert.Contains(xml, "X86"); + StringAssert.Contains(xml, "Framework40"); + StringAssert.Contains(xml, "someplace"); + } - [TestMethod] - public void UpdateRunSettingsWithAnEmptyRunSettingsShouldAddValuesSpecifiedInRunConfiguration() - { - var settings = @""; - var xmlDocument = this.GetXmlDocument(settings); + [TestMethod] + public void UpdateRunSettingsWithAnEmptyRunSettingsShouldAddValuesSpecifiedInRunConfiguration() + { + var settings = @""; + var xmlDocument = this.GetXmlDocument(settings); - InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); + InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); - var xml = xmlDocument.OuterXml; + var xml = xmlDocument.OuterXml; - StringAssert.Contains(xml, "X64"); - StringAssert.Contains(xml, $"{Framework.DefaultFramework.Name}"); - StringAssert.Contains(xml, "temp"); - } + StringAssert.Contains(xml, "X64"); + StringAssert.Contains(xml, $"{Framework.DefaultFramework.Name}"); + StringAssert.Contains(xml, "temp"); + } - [TestMethod] - public void UpdateRunSettingsShouldReturnBackACompleteRunSettings() - { - var settings = @""; - var xmlDocument = this.GetXmlDocument(settings); - - InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); - - var xml = xmlDocument.OuterXml; - var expectedRunSettings = string.Format("tempX64{0}", Framework.DefaultFramework.Name); - - Assert.AreEqual(expectedRunSettings, xml); - } - - [TestMethod] - public void UpdateRunSettingsShouldThrowIfArchitectureSetIsIncompatibleWithCurrentSystemArchitecture() - { - var settings = @""; - var xmlDocument = this.GetXmlDocument(settings); - - Action action = () => InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.ARM, Framework.DefaultFramework, "temp"); - - Assert.That.Throws(action) - .WithMessage(string.Format( - "Incompatible Target platform settings '{0}' with system architecture '{1}'.", - "ARM", - XmlRunSettingsUtilities.OSArchitecture.ToString())); - } - - [TestMethod] - public void UpdateDesignModeOrCsiShouldNotModifyXmlIfNodeIsAlreadyPresent() - { - var settings = @"FalseFalse"; - var xmlDocument = this.GetXmlDocument(settings); - - InferRunSettingsHelper.UpdateDesignMode(xmlDocument, true); - InferRunSettingsHelper.UpdateCollectSourceInformation(xmlDocument, true); - - Assert.AreEqual("False", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/DesignMode")); - Assert.AreEqual("False", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/CollectSourceInformation")); - } - - [DataTestMethod] - [DataRow(true)] - [DataRow(false)] - public void UpdateDesignModeOrCsiShouldModifyXmlToValueProvided(bool val) - { - var settings = @""; - var xmlDocument = this.GetXmlDocument(settings); - - InferRunSettingsHelper.UpdateDesignMode(xmlDocument, val); - InferRunSettingsHelper.UpdateCollectSourceInformation(xmlDocument, val); - - Assert.AreEqual(val.ToString(), this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/DesignMode")); - Assert.AreEqual(val.ToString(), this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/CollectSourceInformation")); - } - - [TestMethod] - public void MakeRunsettingsCompatibleShouldDeleteNewlyAddedRunConfigurationNode() - { - var settings = @"FalseFalse"; - - var result = InferRunSettingsHelper.MakeRunsettingsCompatible(settings); - - Assert.IsTrue(result.IndexOf("DesignMode", StringComparison.OrdinalIgnoreCase) < 0); - } - - [TestMethod] - public void MakeRunsettingsCompatibleShouldNotDeleteOldRunConfigurationNode() - { - var settings = @" - - False - False - x86 - net46 - dummypath - dummypath - dummypath - 2 - False - False - - "; - - var result = InferRunSettingsHelper.MakeRunsettingsCompatible(settings); - - Assert.IsTrue(result.IndexOf("TargetPlatform", StringComparison.OrdinalIgnoreCase) > 0); - Assert.IsTrue(result.IndexOf("TargetFrameworkVersion", StringComparison.OrdinalIgnoreCase) > 0); - Assert.IsTrue(result.IndexOf("TestAdaptersPaths", StringComparison.OrdinalIgnoreCase) > 0); - Assert.IsTrue(result.IndexOf("ResultsDirectory", StringComparison.OrdinalIgnoreCase) > 0); - Assert.IsTrue(result.IndexOf("SolutionDirectory", StringComparison.OrdinalIgnoreCase) > 0); - Assert.IsTrue(result.IndexOf("MaxCpuCount", StringComparison.OrdinalIgnoreCase) > 0); - Assert.IsTrue(result.IndexOf("DisableParallelization", StringComparison.OrdinalIgnoreCase) > 0); - Assert.IsTrue(result.IndexOf("DisableAppDomain", StringComparison.OrdinalIgnoreCase) > 0); - } - - [TestMethod] - public void UpdateTargetDeviceValueFromOldMsTestSettings() - { - var settings = @" - - 2 - False - False - - - 169.254.193.190 - - "; - - var xmlDocument = this.GetXmlDocument(settings); - - var result = InferRunSettingsHelper.TryGetDeviceXml(xmlDocument.CreateNavigator(), out string deviceXml); - Assert.IsTrue(result); - - InferRunSettingsHelper.UpdateTargetDevice(xmlDocument, deviceXml); - Assert.AreEqual(deviceXml.ToString(), this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetDevice")); - } - - [TestMethod] - public void UpdateTargetPlatformShouldNotModifyXmlIfNodeIsAlreadyPresentForOverwriteFalse() - { - var settings = @"x86"; - var xmlDocument = this.GetXmlDocument(settings); - - InferRunSettingsHelper.UpdateTargetPlatform(xmlDocument, "X64", overwrite: false); - - Assert.AreEqual("x86", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetPlatform")); - } - - [TestMethod] - public void UpdateTargetPlatformShouldModifyXmlIfNodeIsAlreadyPresentForOverwriteTrue() - { - var settings = @"x86"; - var xmlDocument = this.GetXmlDocument(settings); - - InferRunSettingsHelper.UpdateTargetPlatform(xmlDocument, "X64", overwrite: true); - - Assert.AreEqual("X64", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetPlatform")); - } - - [TestMethod] - public void UpdateTargetPlatformShouldAddPlatformXmlNodeIfNotPresent() - { - var settings = @""; - var xmlDocument = this.GetXmlDocument(settings); - - InferRunSettingsHelper.UpdateTargetPlatform(xmlDocument, "X64"); - - Assert.AreEqual("X64", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetPlatform")); - } - - [TestMethod] - public void UpdateTargetFrameworkShouldNotModifyXmlIfNodeIsAlreadyPresentForOverwriteFalse() - { - var settings = @".NETFramework,Version=v4.5"; - var xmlDocument = this.GetXmlDocument(settings); - - InferRunSettingsHelper.UpdateTargetFramework(xmlDocument, ".NETCoreApp,Version=v1.0", overwrite: false); - - Assert.AreEqual(".NETFramework,Version=v4.5", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetFrameworkVersion")); - } - - [TestMethod] - public void UpdateTargetFrameworkShouldModifyXmlIfNodeIsAlreadyPresentForOverwriteTrue() - { - var settings = @".NETFramework,Version=v4.5"; - var xmlDocument = this.GetXmlDocument(settings); - - InferRunSettingsHelper.UpdateTargetFramework(xmlDocument, ".NETCoreApp,Version=v1.0", overwrite: true); - - Assert.AreEqual(".NETCoreApp,Version=v1.0", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetFrameworkVersion")); - } - - [TestMethod] - public void UpdateTargetFrameworkShouldAddFrameworkXmlNodeIfNotPresent() - { - var settings = @""; - var xmlDocument = this.GetXmlDocument(settings); - - InferRunSettingsHelper.UpdateTargetFramework(xmlDocument, ".NETCoreApp,Version=v1.0"); - - Assert.AreEqual(".NETCoreApp,Version=v1.0", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetFrameworkVersion")); - } - - [TestMethod] - public void FilterCompatibleSourcesShouldIdentifyIncomaptiableSourcesAndConstructWarningMessage() - { - #region Arrange - sourceArchitectures["AnyCPU1net46.dll"] = Architecture.AnyCPU; - sourceArchitectures["x64net47.exe"] = Architecture.X64; - sourceArchitectures["x86net45.dll"] = Architecture.X86; - - sourceFrameworks["AnyCPU1net46.dll"] = frameworkNet46; - sourceFrameworks["x64net47.exe"] = frameworkNet47; - sourceFrameworks["x86net45.dll"] = frameworkNet45; - - StringBuilder sb = new StringBuilder(); - sb.AppendLine(); - sb.AppendLine(GetSourceIncompatibleMessage("AnyCPU1net46.dll")); - sb.AppendLine(GetSourceIncompatibleMessage("x64net47.exe")); - sb.AppendLine(GetSourceIncompatibleMessage("x86net45.dll")); - - var expected = string.Format(CultureInfo.CurrentCulture, OMResources.DisplayChosenSettings, frameworkNet47, Constants.DefaultPlatform, sb.ToString(), @"http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409"); - #endregion - - string warningMessage = string.Empty; - var compatibleSources = InferRunSettingsHelper.FilterCompatibleSources(Constants.DefaultPlatform, frameworkNet47, sourceArchitectures, sourceFrameworks, out warningMessage); - - // None of the DLLs passed are compatible to the chosen settings - Assert.AreEqual(0, compatibleSources.Count()); - Assert.AreEqual(expected, warningMessage); - } - - [TestMethod] - public void FilterCompatibleSourcesShouldIdentifyCompatibleSources() - { - sourceArchitectures["x64net45.exe"] = Architecture.X64; - sourceArchitectures["x86net45.dll"] = Architecture.X86; - - sourceFrameworks["x64net45.exe"] = frameworkNet45; - sourceFrameworks["x86net45.dll"] = frameworkNet45; - - StringBuilder sb = new StringBuilder(); - sb.AppendLine(); - sb.AppendLine(GetSourceIncompatibleMessage("x64net45.exe")); - - var expected = string.Format(CultureInfo.CurrentCulture, OMResources.DisplayChosenSettings, frameworkNet45, Constants.DefaultPlatform, sb.ToString(), @"http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409"); - - string warningMessage = string.Empty; - var compatibleSources = InferRunSettingsHelper.FilterCompatibleSources(Constants.DefaultPlatform, frameworkNet45, sourceArchitectures, sourceFrameworks, out warningMessage); - - // only "x86net45.dll" is the compatible source - Assert.AreEqual(1, compatibleSources.Count()); - Assert.AreEqual(expected, warningMessage); - } - - [TestMethod] - public void FilterCompatibleSourcesShouldNotComposeWarningIfSettingsAreCorrect() - { - sourceArchitectures["x86net45.dll"] = Architecture.X86; - sourceFrameworks["x86net45.dll"] = frameworkNet45; - - string warningMessage = string.Empty; - var compatibleSources = InferRunSettingsHelper.FilterCompatibleSources(Constants.DefaultPlatform, frameworkNet45, sourceArchitectures, sourceFrameworks, out warningMessage); - - // only "x86net45.dll" is the compatible source - Assert.AreEqual(1, compatibleSources.Count()); - Assert.IsTrue(string.IsNullOrEmpty(warningMessage)); - } - - [TestMethod] - public void FilterCompatibleSourcesShouldRetrunWarningMessageIfNoConflict() - { - sourceArchitectures["x64net45.exe"] = Architecture.X64; - sourceFrameworks["x64net45.exe"] = frameworkNet45; - - string warningMessage = string.Empty; - var compatibleSources = InferRunSettingsHelper.FilterCompatibleSources(Architecture.X64, frameworkNet45, sourceArchitectures, sourceFrameworks, out warningMessage); - - Assert.IsTrue(string.IsNullOrEmpty(warningMessage)); - } - - [TestMethod] - public void IsTestSettingsEnabledShouldReturnTrueIfRunsettingsHasTestSettings() - { - string runsettingsString = @" - - C:\temp.testsettings - true - - "; - - Assert.IsTrue(InferRunSettingsHelper.IsTestSettingsEnabled(runsettingsString)); - } - - [TestMethod] - public void IsTestSettingsEnabledShouldReturnFalseIfRunsettingsDoesnotHaveTestSettings() - { - string runsettingsString = @" - - true - - "; - - Assert.IsFalse(InferRunSettingsHelper.IsTestSettingsEnabled(runsettingsString)); - } - - [TestMethod] - public void TryGetLegacySettingsForRunSettingsWithoutLegacySettingsShouldReturnFalse() - { - string runSettingsXml = @" - "; - - Assert.IsFalse(InferRunSettingsHelper.TryGetLegacySettingElements(runSettingsXml, out Dictionary legacySettings)); - } - - [TestMethod] - public void TryGetLegacySettingsForRunSettingsWithInvalidLegacySettingsShouldReturnFalse() - { - string runSettingsXml = @" - - - - "; - - Assert.IsFalse(InferRunSettingsHelper.TryGetLegacySettingElements(runSettingsXml, out Dictionary legacySettings)); - } - - [TestMethod] - public void TryGetLegacySettingsForRunSettingsWithEmptyLegacySettingsShouldReturnTrueAndEmptyListForLegacySettingElements() - { - string runSettingsXml = @" - - - "; - - Assert.IsTrue(InferRunSettingsHelper.TryGetLegacySettingElements(runSettingsXml, out Dictionary legacySettings)); - Assert.AreEqual(0, legacySettings.Count); - } - - [TestMethod] - public void TryGetLegacySettingsForRunSettingsWithValidLegacySettingsShouldReturnTrueAndListForLegacySettingElements() - { - string runSettingsXml = @" - - - - - - - - - - - - - - - - "; - - var expectedElements = "Deployment, Scripts, Execution, AssemblyResolution, Timeouts, Hosts"; - var expectedDeploymentAttributes = "enabled, deploySatelliteAssemblies"; - var expectedExecutionAttributes = "hostProcessPlatform, parallelTestCount"; - - Assert.IsTrue(InferRunSettingsHelper.TryGetLegacySettingElements(runSettingsXml, out Dictionary legacySettings)); - Assert.AreEqual(3, legacySettings.Count, "count does not match"); - Assert.AreEqual(expectedElements, legacySettings["Elements"]); - Assert.AreEqual(expectedDeploymentAttributes, legacySettings["DeploymentAttributes"]); - Assert.AreEqual(expectedExecutionAttributes, legacySettings["ExecutionAttributes"]); - } - - [TestMethod] - public void GetEnvironmentVariablesWithValidValuesInRunSettingsShouldReturnValidDictionary() - { - string runSettingsXml = @" - - - C:\temp - C:\temp2 - - - "; - - var envVars = InferRunSettingsHelper.GetEnvironmentVariables(runSettingsXml); - - Assert.AreEqual(2, envVars.Count); - Assert.AreEqual(envVars["RANDOM_PATH"], @"C:\temp"); - Assert.AreEqual(envVars["RANDOM_PATH2"], @"C:\temp2"); - } - - [TestMethod] - public void GetEnvironmentVariablesWithDuplicateEnvValuesInRunSettingsShouldReturnValidDictionary() - { - string runSettingsXml = @" - - - C:\temp - C:\temp2 - - - "; - - var envVars = InferRunSettingsHelper.GetEnvironmentVariables(runSettingsXml); - - Assert.AreEqual(1, envVars.Count); - Assert.AreEqual(envVars["RANDOM_PATH"], @"C:\temp"); - } - - [TestMethod] - public void GetEnvironmentVariablesWithEmptyVariablesInRunSettingsShouldReturnEmptyDictionary() - { - string runSettingsXml = @" - - - - - "; - - var envVars = InferRunSettingsHelper.GetEnvironmentVariables(runSettingsXml); - Assert.AreEqual(0, envVars.Count); - } - - [TestMethod] - public void GetEnvironmentVariablesWithInvalidValuesInRunSettingsShouldReturnNull() - { - string runSettingsXml = @" - - - - - - "; - - var envVars = InferRunSettingsHelper.GetEnvironmentVariables(runSettingsXml); - Assert.IsNull(envVars); - } - - [TestMethod] - public void GetEnvironmentVariablesWithoutEnvVarNodeInRunSettingsShouldReturnNull() - { - string runSettingsXml = @" - - - "; - - var envVars = InferRunSettingsHelper.GetEnvironmentVariables(runSettingsXml); - Assert.IsNull(envVars); - } - - #region RunSettingsIncompatibeWithTestSettings Tests - - [TestMethod] - public void RunSettingsWithCodeCoverageAndInlineTestSettingsXml() - { - // Setup - var runSettingsWithCodeCoverageAndInlineTestSettingsXml = @" - - - Framework45 - C:\TestProject1\TestResults - C:\TestProject1\ - X86 - - - C:\TestProject1\TestSettings1.testsettings - true - true - - - - - - DevBox 2018-01-07 20_42_30.coverage - - - - - - - "; - - // Act and validate - Assert.IsFalse(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( - runSettingsWithCodeCoverageAndInlineTestSettingsXml), "Invalid response"); - Assert.IsTrue(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( - ConvertOutOfProcToInProcDataCollectionSettings(runSettingsWithCodeCoverageAndInlineTestSettingsXml)), "Invalid response"); - } - - [TestMethod] - public void RunSettingsWithFakesAndCodeCoverageAndInlineTestSettingsXml() - { - var runSettingsWithFakesAndCodeCoverageAndInlineTestSettingsXml = @" - - - Framework45 - C:\TestProject1\TestResults - C:\TestProject1\ - X86 - - - C:\TestProject1\TestSettings1.testsettings - true - true - - - - - - - - - - "; - - // Act and validate - Assert.IsFalse(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( - runSettingsWithFakesAndCodeCoverageAndInlineTestSettingsXml), "Invalid response"); - Assert.IsTrue(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( - ConvertOutOfProcToInProcDataCollectionSettings(runSettingsWithFakesAndCodeCoverageAndInlineTestSettingsXml)), "Invalid response"); - } - - [TestMethod] - public void RunSettingsWithEnabledAndDisabledCollectorAndNoEmbeddedTestSettingsXml() - { - var runSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml = @" - - - Framework45 - C:\TestProject1\TestResults - C:\TestProject1\ - X86 - - - - - - - - - - - - "; - - // Act and validate - Assert.IsFalse(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( - runSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml), "Invalid response"); - Assert.IsFalse(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( - ConvertOutOfProcToInProcDataCollectionSettings(runSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml)), "Invalid response"); - } - - [TestMethod] - public void RunSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml() - { - var runSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml = @" - - - Framework45 - C:\TestProject1\TestResults - C:\TestProject1\ - X86 - - - C:\TestProject1\TestSettings1.testsettings - true - true - - - - - - - - - - - - "; - - // Act and validate - Assert.IsTrue(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( - runSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml), "Invalid response"); - Assert.IsTrue(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( - ConvertOutOfProcToInProcDataCollectionSettings(runSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml)), "Invalid response"); - } - - [TestMethod] - public void RunSettingsWithDisabledCollectionSettingsAndInlineTestSettingsXml() - { - var runSettingsWithDisabledCollectionSettingsAndInlineTestSettingsXml = @" - - - Framework45 - C:\TestProject1\TestResults - C:\TestProject1\ - X86 - - - C:\TestProject1\TestSettings1.testsettings - true - true - - - - - - - - - - - - "; - - // Act and validate - Assert.IsFalse(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( - runSettingsWithDisabledCollectionSettingsAndInlineTestSettingsXml), "Invalid response"); - Assert.IsFalse(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( - ConvertOutOfProcToInProcDataCollectionSettings(runSettingsWithDisabledCollectionSettingsAndInlineTestSettingsXml)), "Invalid response"); - } - - #endregion - - #region private methods - - private string GetSourceIncompatibleMessage(string source) - { - return string.Format(CultureInfo.CurrentCulture, OMResources.SourceIncompatible, source, sourceFrameworks[source].Name, sourceArchitectures[source]); - } - - private XmlDocument GetXmlDocument(string settingsXml) - { - var doc = new XmlDocument(); - doc.LoadXml(settingsXml); - - return doc; - } - - private string GetValueOf(XmlDocument xmlDocument, string xpath) - { - return xmlDocument.SelectSingleNode(xpath).InnerText; - } - - private string ConvertOutOfProcToInProcDataCollectionSettings(string settings) - { - return settings.Replace("DataCollectionRunSettings", "InProcDataCollectionRunSettings") - .Replace("", "") - .Replace("", "") - .Replace("", ""); - } - - #endregion - } + [TestMethod] + public void UpdateRunSettingsShouldReturnBackACompleteRunSettings() + { + var settings = @""; + var xmlDocument = this.GetXmlDocument(settings); + + InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.X64, Framework.DefaultFramework, "temp"); + + var xml = xmlDocument.OuterXml; + var expectedRunSettings = string.Format("tempX64{0}", Framework.DefaultFramework.Name); + + Assert.AreEqual(expectedRunSettings, xml); + } + + [TestMethod] + public void UpdateRunSettingsShouldThrowIfArchitectureSetIsIncompatibleWithCurrentSystemArchitecture() + { + var settings = @""; + var xmlDocument = this.GetXmlDocument(settings); + + Action action = () => InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.ARM, Framework.DefaultFramework, "temp"); + + Assert.That.Throws(action) + .WithMessage(string.Format( + "Incompatible Target platform settings '{0}' with system architecture '{1}'.", + "ARM", + XmlRunSettingsUtilities.OSArchitecture.ToString())); + } + + [TestMethod] + public void UpdateDesignModeOrCsiShouldNotModifyXmlIfNodeIsAlreadyPresent() + { + var settings = @"FalseFalse"; + var xmlDocument = this.GetXmlDocument(settings); + + InferRunSettingsHelper.UpdateDesignMode(xmlDocument, true); + InferRunSettingsHelper.UpdateCollectSourceInformation(xmlDocument, true); + + Assert.AreEqual("False", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/DesignMode")); + Assert.AreEqual("False", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/CollectSourceInformation")); + } + + [DataTestMethod] + [DataRow(true)] + [DataRow(false)] + public void UpdateDesignModeOrCsiShouldModifyXmlToValueProvided(bool val) + { + var settings = @""; + var xmlDocument = this.GetXmlDocument(settings); + + InferRunSettingsHelper.UpdateDesignMode(xmlDocument, val); + InferRunSettingsHelper.UpdateCollectSourceInformation(xmlDocument, val); + + Assert.AreEqual(val.ToString(), this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/DesignMode")); + Assert.AreEqual(val.ToString(), this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/CollectSourceInformation")); + } + + [TestMethod] + public void MakeRunsettingsCompatibleShouldDeleteNewlyAddedRunConfigurationNode() + { + var settings = @"FalseFalse"; + + var result = InferRunSettingsHelper.MakeRunsettingsCompatible(settings); + + Assert.IsTrue(result.IndexOf("DesignMode", StringComparison.OrdinalIgnoreCase) < 0); + } + + [TestMethod] + public void MakeRunsettingsCompatibleShouldNotDeleteOldRunConfigurationNode() + { + var settings = @" + + False + False + x86 + net46 + dummypath + dummypath + dummypath + 2 + False + False + + "; + + var result = InferRunSettingsHelper.MakeRunsettingsCompatible(settings); + + Assert.IsTrue(result.IndexOf("TargetPlatform", StringComparison.OrdinalIgnoreCase) > 0); + Assert.IsTrue(result.IndexOf("TargetFrameworkVersion", StringComparison.OrdinalIgnoreCase) > 0); + Assert.IsTrue(result.IndexOf("TestAdaptersPaths", StringComparison.OrdinalIgnoreCase) > 0); + Assert.IsTrue(result.IndexOf("ResultsDirectory", StringComparison.OrdinalIgnoreCase) > 0); + Assert.IsTrue(result.IndexOf("SolutionDirectory", StringComparison.OrdinalIgnoreCase) > 0); + Assert.IsTrue(result.IndexOf("MaxCpuCount", StringComparison.OrdinalIgnoreCase) > 0); + Assert.IsTrue(result.IndexOf("DisableParallelization", StringComparison.OrdinalIgnoreCase) > 0); + Assert.IsTrue(result.IndexOf("DisableAppDomain", StringComparison.OrdinalIgnoreCase) > 0); + } + + [TestMethod] + public void UpdateTargetDeviceValueFromOldMsTestSettings() + { + var settings = @" + + 2 + False + False + + + 169.254.193.190 + + "; + + var xmlDocument = this.GetXmlDocument(settings); + + var result = InferRunSettingsHelper.TryGetDeviceXml(xmlDocument.CreateNavigator(), out string deviceXml); + Assert.IsTrue(result); + + InferRunSettingsHelper.UpdateTargetDevice(xmlDocument, deviceXml); + Assert.AreEqual(deviceXml.ToString(), this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetDevice")); + } + + [TestMethod] + public void UpdateTargetPlatformShouldNotModifyXmlIfNodeIsAlreadyPresentForOverwriteFalse() + { + var settings = @"x86"; + var xmlDocument = this.GetXmlDocument(settings); + + InferRunSettingsHelper.UpdateTargetPlatform(xmlDocument, "X64", overwrite: false); + + Assert.AreEqual("x86", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetPlatform")); + } + + [TestMethod] + public void UpdateTargetPlatformShouldModifyXmlIfNodeIsAlreadyPresentForOverwriteTrue() + { + var settings = @"x86"; + var xmlDocument = this.GetXmlDocument(settings); + + InferRunSettingsHelper.UpdateTargetPlatform(xmlDocument, "X64", overwrite: true); + + Assert.AreEqual("X64", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetPlatform")); + } + + [TestMethod] + public void UpdateTargetPlatformShouldAddPlatformXmlNodeIfNotPresent() + { + var settings = @""; + var xmlDocument = this.GetXmlDocument(settings); + + InferRunSettingsHelper.UpdateTargetPlatform(xmlDocument, "X64"); + + Assert.AreEqual("X64", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetPlatform")); + } + + [TestMethod] + public void UpdateTargetFrameworkShouldNotModifyXmlIfNodeIsAlreadyPresentForOverwriteFalse() + { + var settings = @".NETFramework,Version=v4.5"; + var xmlDocument = this.GetXmlDocument(settings); + + InferRunSettingsHelper.UpdateTargetFramework(xmlDocument, ".NETCoreApp,Version=v1.0", overwrite: false); + + Assert.AreEqual(".NETFramework,Version=v4.5", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetFrameworkVersion")); + } + + [TestMethod] + public void UpdateTargetFrameworkShouldModifyXmlIfNodeIsAlreadyPresentForOverwriteTrue() + { + var settings = @".NETFramework,Version=v4.5"; + var xmlDocument = this.GetXmlDocument(settings); + + InferRunSettingsHelper.UpdateTargetFramework(xmlDocument, ".NETCoreApp,Version=v1.0", overwrite: true); + + Assert.AreEqual(".NETCoreApp,Version=v1.0", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetFrameworkVersion")); + } + + [TestMethod] + public void UpdateTargetFrameworkShouldAddFrameworkXmlNodeIfNotPresent() + { + var settings = @""; + var xmlDocument = this.GetXmlDocument(settings); + + InferRunSettingsHelper.UpdateTargetFramework(xmlDocument, ".NETCoreApp,Version=v1.0"); + + Assert.AreEqual(".NETCoreApp,Version=v1.0", this.GetValueOf(xmlDocument, "/RunSettings/RunConfiguration/TargetFrameworkVersion")); + } + + [TestMethod] + public void FilterCompatibleSourcesShouldIdentifyIncomaptiableSourcesAndConstructWarningMessage() + { + #region Arrange + sourceArchitectures["AnyCPU1net46.dll"] = Architecture.AnyCPU; + sourceArchitectures["x64net47.exe"] = Architecture.X64; + sourceArchitectures["x86net45.dll"] = Architecture.X86; + + sourceFrameworks["AnyCPU1net46.dll"] = frameworkNet46; + sourceFrameworks["x64net47.exe"] = frameworkNet47; + sourceFrameworks["x86net45.dll"] = frameworkNet45; + + StringBuilder sb = new StringBuilder(); + sb.AppendLine(); + sb.AppendLine(GetSourceIncompatibleMessage("AnyCPU1net46.dll")); + sb.AppendLine(GetSourceIncompatibleMessage("x64net47.exe")); + sb.AppendLine(GetSourceIncompatibleMessage("x86net45.dll")); + + var expected = string.Format(CultureInfo.CurrentCulture, OMResources.DisplayChosenSettings, frameworkNet47, Constants.DefaultPlatform, sb.ToString(), @"http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409"); + #endregion + + string warningMessage = string.Empty; + var compatibleSources = InferRunSettingsHelper.FilterCompatibleSources(Constants.DefaultPlatform, frameworkNet47, sourceArchitectures, sourceFrameworks, out warningMessage); + + // None of the DLLs passed are compatible to the chosen settings + Assert.AreEqual(0, compatibleSources.Count()); + Assert.AreEqual(expected, warningMessage); + } + + [TestMethod] + public void FilterCompatibleSourcesShouldIdentifyCompatibleSources() + { + sourceArchitectures["x64net45.exe"] = Architecture.X64; + sourceArchitectures["x86net45.dll"] = Architecture.X86; + + sourceFrameworks["x64net45.exe"] = frameworkNet45; + sourceFrameworks["x86net45.dll"] = frameworkNet45; + + StringBuilder sb = new StringBuilder(); + sb.AppendLine(); + sb.AppendLine(GetSourceIncompatibleMessage("x64net45.exe")); + + var expected = string.Format(CultureInfo.CurrentCulture, OMResources.DisplayChosenSettings, frameworkNet45, Constants.DefaultPlatform, sb.ToString(), @"http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409"); + + string warningMessage = string.Empty; + var compatibleSources = InferRunSettingsHelper.FilterCompatibleSources(Constants.DefaultPlatform, frameworkNet45, sourceArchitectures, sourceFrameworks, out warningMessage); + + // only "x86net45.dll" is the compatible source + Assert.AreEqual(1, compatibleSources.Count()); + Assert.AreEqual(expected, warningMessage); + } + + [TestMethod] + public void FilterCompatibleSourcesShouldNotComposeWarningIfSettingsAreCorrect() + { + sourceArchitectures["x86net45.dll"] = Architecture.X86; + sourceFrameworks["x86net45.dll"] = frameworkNet45; + + string warningMessage = string.Empty; + var compatibleSources = InferRunSettingsHelper.FilterCompatibleSources(Constants.DefaultPlatform, frameworkNet45, sourceArchitectures, sourceFrameworks, out warningMessage); + + // only "x86net45.dll" is the compatible source + Assert.AreEqual(1, compatibleSources.Count()); + Assert.IsTrue(string.IsNullOrEmpty(warningMessage)); + } + + [TestMethod] + public void FilterCompatibleSourcesShouldRetrunWarningMessageIfNoConflict() + { + sourceArchitectures["x64net45.exe"] = Architecture.X64; + sourceFrameworks["x64net45.exe"] = frameworkNet45; + + string warningMessage = string.Empty; + var compatibleSources = InferRunSettingsHelper.FilterCompatibleSources(Architecture.X64, frameworkNet45, sourceArchitectures, sourceFrameworks, out warningMessage); + + Assert.IsTrue(string.IsNullOrEmpty(warningMessage)); + } + + [TestMethod] + public void IsTestSettingsEnabledShouldReturnTrueIfRunsettingsHasTestSettings() + { + string runsettingsString = @" + + C:\temp.testsettings + true + + "; + + Assert.IsTrue(InferRunSettingsHelper.IsTestSettingsEnabled(runsettingsString)); + } + + [TestMethod] + public void IsTestSettingsEnabledShouldReturnFalseIfRunsettingsDoesnotHaveTestSettings() + { + string runsettingsString = @" + + true + + "; + + Assert.IsFalse(InferRunSettingsHelper.IsTestSettingsEnabled(runsettingsString)); + } + + [TestMethod] + public void TryGetLegacySettingsForRunSettingsWithoutLegacySettingsShouldReturnFalse() + { + string runSettingsXml = @" + "; + + Assert.IsFalse(InferRunSettingsHelper.TryGetLegacySettingElements(runSettingsXml, out Dictionary legacySettings)); + } + + [TestMethod] + public void TryGetLegacySettingsForRunSettingsWithInvalidLegacySettingsShouldReturnFalse() + { + string runSettingsXml = @" + + + + "; + + Assert.IsFalse(InferRunSettingsHelper.TryGetLegacySettingElements(runSettingsXml, out Dictionary legacySettings)); + } + + [TestMethod] + public void TryGetLegacySettingsForRunSettingsWithEmptyLegacySettingsShouldReturnTrueAndEmptyListForLegacySettingElements() + { + string runSettingsXml = @" + + + "; + + Assert.IsTrue(InferRunSettingsHelper.TryGetLegacySettingElements(runSettingsXml, out Dictionary legacySettings)); + Assert.AreEqual(0, legacySettings.Count); + } + + [TestMethod] + public void TryGetLegacySettingsForRunSettingsWithValidLegacySettingsShouldReturnTrueAndListForLegacySettingElements() + { + string runSettingsXml = @" + + + + + + + + + + + + + + + + "; + + var expectedElements = "Deployment, Scripts, Execution, AssemblyResolution, Timeouts, Hosts"; + var expectedDeploymentAttributes = "enabled, deploySatelliteAssemblies"; + var expectedExecutionAttributes = "hostProcessPlatform, parallelTestCount"; + + Assert.IsTrue(InferRunSettingsHelper.TryGetLegacySettingElements(runSettingsXml, out Dictionary legacySettings)); + Assert.AreEqual(3, legacySettings.Count, "count does not match"); + Assert.AreEqual(expectedElements, legacySettings["Elements"]); + Assert.AreEqual(expectedDeploymentAttributes, legacySettings["DeploymentAttributes"]); + Assert.AreEqual(expectedExecutionAttributes, legacySettings["ExecutionAttributes"]); + } + + [TestMethod] + public void GetEnvironmentVariablesWithValidValuesInRunSettingsShouldReturnValidDictionary() + { + string runSettingsXml = @" + + + C:\temp + C:\temp2 + + + "; + + var envVars = InferRunSettingsHelper.GetEnvironmentVariables(runSettingsXml); + + Assert.AreEqual(2, envVars.Count); + Assert.AreEqual(envVars["RANDOM_PATH"], @"C:\temp"); + Assert.AreEqual(envVars["RANDOM_PATH2"], @"C:\temp2"); + } + + [TestMethod] + public void GetEnvironmentVariablesWithDuplicateEnvValuesInRunSettingsShouldReturnValidDictionary() + { + string runSettingsXml = @" + + + C:\temp + C:\temp2 + + + "; + + var envVars = InferRunSettingsHelper.GetEnvironmentVariables(runSettingsXml); + + Assert.AreEqual(1, envVars.Count); + Assert.AreEqual(envVars["RANDOM_PATH"], @"C:\temp"); + } + + [TestMethod] + public void GetEnvironmentVariablesWithEmptyVariablesInRunSettingsShouldReturnEmptyDictionary() + { + string runSettingsXml = @" + + + + + "; + + var envVars = InferRunSettingsHelper.GetEnvironmentVariables(runSettingsXml); + Assert.AreEqual(0, envVars.Count); + } + + [TestMethod] + public void GetEnvironmentVariablesWithInvalidValuesInRunSettingsShouldReturnNull() + { + string runSettingsXml = @" + + + + + + "; + + var envVars = InferRunSettingsHelper.GetEnvironmentVariables(runSettingsXml); + Assert.IsNull(envVars); + } + + [TestMethod] + public void GetEnvironmentVariablesWithoutEnvVarNodeInRunSettingsShouldReturnNull() + { + string runSettingsXml = @" + + + "; + + var envVars = InferRunSettingsHelper.GetEnvironmentVariables(runSettingsXml); + Assert.IsNull(envVars); + } + + #region RunSettingsIncompatibeWithTestSettings Tests + + [TestMethod] + public void RunSettingsWithCodeCoverageAndInlineTestSettingsXml() + { + // Setup + var runSettingsWithCodeCoverageAndInlineTestSettingsXml = @" + + + Framework45 + C:\TestProject1\TestResults + C:\TestProject1\ + X86 + + + C:\TestProject1\TestSettings1.testsettings + true + true + + + + + + DevBox 2018-01-07 20_42_30.coverage + + + + + + + "; + + // Act and validate + Assert.IsFalse(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( + runSettingsWithCodeCoverageAndInlineTestSettingsXml), "Invalid response"); + Assert.IsTrue(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( + ConvertOutOfProcToInProcDataCollectionSettings(runSettingsWithCodeCoverageAndInlineTestSettingsXml)), "Invalid response"); + } + + [TestMethod] + public void RunSettingsWithFakesAndCodeCoverageAndInlineTestSettingsXml() + { + var runSettingsWithFakesAndCodeCoverageAndInlineTestSettingsXml = @" + + + Framework45 + C:\TestProject1\TestResults + C:\TestProject1\ + X86 + + + C:\TestProject1\TestSettings1.testsettings + true + true + + + + + + + + + + "; + + // Act and validate + Assert.IsFalse(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( + runSettingsWithFakesAndCodeCoverageAndInlineTestSettingsXml), "Invalid response"); + Assert.IsTrue(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( + ConvertOutOfProcToInProcDataCollectionSettings(runSettingsWithFakesAndCodeCoverageAndInlineTestSettingsXml)), "Invalid response"); + } + + [TestMethod] + public void RunSettingsWithEnabledAndDisabledCollectorAndNoEmbeddedTestSettingsXml() + { + var runSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml = @" + + + Framework45 + C:\TestProject1\TestResults + C:\TestProject1\ + X86 + + + + + + + + + + + + "; + + // Act and validate + Assert.IsFalse(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( + runSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml), "Invalid response"); + Assert.IsFalse(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( + ConvertOutOfProcToInProcDataCollectionSettings(runSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml)), "Invalid response"); + } + + [TestMethod] + public void RunSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml() + { + var runSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml = @" + + + Framework45 + C:\TestProject1\TestResults + C:\TestProject1\ + X86 + + + C:\TestProject1\TestSettings1.testsettings + true + true + + + + + + + + + + + + "; + + // Act and validate + Assert.IsTrue(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( + runSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml), "Invalid response"); + Assert.IsTrue(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( + ConvertOutOfProcToInProcDataCollectionSettings(runSettingsWithEnabledAndDisabledCollectorAndInlineTestSettingsXml)), "Invalid response"); + } + + [TestMethod] + public void RunSettingsWithDisabledCollectionSettingsAndInlineTestSettingsXml() + { + var runSettingsWithDisabledCollectionSettingsAndInlineTestSettingsXml = @" + + + Framework45 + C:\TestProject1\TestResults + C:\TestProject1\ + X86 + + + C:\TestProject1\TestSettings1.testsettings + true + true + + + + + + + + + + + + "; + + // Act and validate + Assert.IsFalse(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( + runSettingsWithDisabledCollectionSettingsAndInlineTestSettingsXml), "Invalid response"); + Assert.IsFalse(InferRunSettingsHelper.AreRunSettingsCollectorsInCompatibleWithTestSettings( + ConvertOutOfProcToInProcDataCollectionSettings(runSettingsWithDisabledCollectionSettingsAndInlineTestSettingsXml)), "Invalid response"); + } + + #endregion + + #region Private Methods + + private string GetSourceIncompatibleMessage(string source) + { + return string.Format(CultureInfo.CurrentCulture, OMResources.SourceIncompatible, source, sourceFrameworks[source].Name, sourceArchitectures[source]); + } + + private XmlDocument GetXmlDocument(string settingsXml) + { + var doc = new XmlDocument(); + doc.LoadXml(settingsXml); + + return doc; + } + + private string GetValueOf(XmlDocument xmlDocument, string xpath) + { + return xmlDocument.SelectSingleNode(xpath).InnerText; + } + + private string ConvertOutOfProcToInProcDataCollectionSettings(string settings) + { + return settings.Replace("DataCollectionRunSettings", "InProcDataCollectionRunSettings") + .Replace("", "") + .Replace("", "") + .Replace("", ""); + } + + #endregion + } } diff --git a/test/Microsoft.TestPlatform.Utilities.UnitTests/Program.cs b/test/Microsoft.TestPlatform.Utilities.UnitTests/Program.cs index fe1004c027..7feda95b4b 100644 --- a/test/Microsoft.TestPlatform.Utilities.UnitTests/Program.cs +++ b/test/Microsoft.TestPlatform.Utilities.UnitTests/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. namespace Microsoft.TestPlatform.Utilities.UnitTests -{ +{ public static class Program { public static void Main(string[] args) diff --git a/test/TestAssets/ProjectFileRunSettingsTestProject/UnitTest1.cs b/test/TestAssets/ProjectFileRunSettingsTestProject/UnitTest1.cs index 8e05942a5d..0ec4b790f2 100644 --- a/test/TestAssets/ProjectFileRunSettingsTestProject/UnitTest1.cs +++ b/test/TestAssets/ProjectFileRunSettingsTestProject/UnitTest1.cs @@ -9,10 +9,10 @@ public class UnitTest1 public void TestMethod1() { // this project specifies runsettings in it's proj file - // that runsettings say that inconclusive should translate to - // failed. - // we can then easily figure out if the settings were applied - // correctly if we set the test as failed, or did not apply if the + // that runsettings say that inconclusive should translate to + // failed. + // we can then easily figure out if the settings were applied + // correctly if we set the test as failed, or did not apply if the // test is shown as skipped Assert.Inconclusive(); } diff --git a/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs b/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs index 36f8c2adce..191acf0fe2 100644 --- a/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs +++ b/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs @@ -13,7 +13,7 @@ namespace Coverlet.Collector.DataCollection { - // This class MUST have the same full name as + // This class MUST have the same full name as // https://github.com/tonerdo/coverlet/blob/master/src/coverlet.collector/InProcDataCollection/CoverletInProcDataCollector.cs // to mimic real behavior public class CoverletInProcDataCollector : InProcDataCollection diff --git a/test/TranslationLayer.UnitTests/Program.cs b/test/TranslationLayer.UnitTests/Program.cs index 44becc5a1c..cb4dfb25dc 100644 --- a/test/TranslationLayer.UnitTests/Program.cs +++ b/test/TranslationLayer.UnitTests/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. namespace Microsoft.TestPlatform.VsTestConsole.TranslationLayer.UnitTests -{ +{ public static class Program { public static void Main(string[] args) diff --git a/test/TranslationLayer.UnitTests/VsTestConsoleRequestSenderTests.cs b/test/TranslationLayer.UnitTests/VsTestConsoleRequestSenderTests.cs index c828477a6f..500b4acbe5 100644 --- a/test/TranslationLayer.UnitTests/VsTestConsoleRequestSenderTests.cs +++ b/test/TranslationLayer.UnitTests/VsTestConsoleRequestSenderTests.cs @@ -931,7 +931,7 @@ public void StartTestRunShouldIncludeFilterInRequestPayload() this.SetupMockCommunicationForRunRequest(mockHandler); this.mockCommunicationManager.Setup(cm => cm.SendMessage(MessageType.TestRunAllSourcesWithDefaultHost, It.IsAny(), It.IsAny())). Callback((string msg, object requestpayload, int protocol) => { receivedRequest = (TestRunRequestPayload)requestpayload; }); - + // Act. this.requestSender.StartTestRun(sources, null, new TestPlatformOptions() { TestCaseFilter = filter }, mockHandler.Object); @@ -1938,7 +1938,7 @@ private void InitializeCommunication() var connectionSuccess = this.requestSender.WaitForRequestHandlerConnection(this.WaitTimeout); Assert.IsTrue(connectionSuccess, "Connection must succeed."); } - + private void SetupMockCommunicationForRunRequest(Mock mockHandler) { this.InitializeCommunication(); diff --git a/test/datacollector.PlatformTests/CutomDataCollector.cs b/test/datacollector.PlatformTests/CustomDataCollector.cs similarity index 100% rename from test/datacollector.PlatformTests/CutomDataCollector.cs rename to test/datacollector.PlatformTests/CustomDataCollector.cs diff --git a/test/testhost.UnitTests/AppDomainEngineInvokerTests.cs b/test/testhost.UnitTests/AppDomainEngineInvokerTests.cs index b6ba8fbefa..31701a1ed6 100644 --- a/test/testhost.UnitTests/AppDomainEngineInvokerTests.cs +++ b/test/testhost.UnitTests/AppDomainEngineInvokerTests.cs @@ -51,7 +51,7 @@ public void AppDomainEngineInvokerShouldCreateNewAppDomain() Assert.IsNotNull(appDomainInvoker.NewAppDomain, "New AppDomain must be created."); Assert.IsNotNull(appDomainInvoker.ActualInvoker, "Invoker must be created."); - Assert.AreNotEqual(AppDomain.CurrentDomain.FriendlyName, appDomainInvoker.NewAppDomain.FriendlyName, + Assert.AreNotEqual(AppDomain.CurrentDomain.FriendlyName, appDomainInvoker.NewAppDomain.FriendlyName, "New AppDomain must be different from default one."); } @@ -65,7 +65,7 @@ public void AppDomainEngineInvokerShouldInvokeEngineInNewDomainAndUseTestHostCon Assert.IsNotNull(newAppDomain, "New AppDomain must be created."); Assert.IsNotNull(appDomainInvoker.ActualInvoker, "Invoker must be created."); - Assert.AreNotEqual(AppDomain.CurrentDomain.FriendlyName, + Assert.AreNotEqual(AppDomain.CurrentDomain.FriendlyName, (appDomainInvoker.ActualInvoker as MockEngineInvoker).DomainFriendlyName, "Engine must be invoked in new domain."); @@ -78,7 +78,7 @@ public void AppDomainEngineInvokerShouldUseTestHostStartupConfigAndRuntimeAfterM { string appConfig = @" - + "; @@ -189,7 +189,7 @@ public void AppDomainEngineInvokerShouldUseDiagAndAppSettingsElementsUnMergedFro var diagAddNodes = diagEle.Descendants("add"); Assert.AreEqual(1, diagAddNodes.Count(), "Only switches from user config should be present."); - Assert.AreEqual(@"", diagAddNodes.First().ToString(), + Assert.AreEqual(@"", diagAddNodes.First().ToString(), "Correct Switch must be merged."); var appSettingsAddNodes = appSettingsEle.Descendants("add"); @@ -207,7 +207,7 @@ public TestableEngineInvoker(string testSourcePath) : base(testSourcePath) public static XDocument MergeConfigXmls(string userConfigText, string testHostConfigText) { return MergeApplicationConfigFiles( - XDocument.Load(new MemoryStream(Encoding.UTF8.GetBytes(userConfigText))), + XDocument.Load(new MemoryStream(Encoding.UTF8.GetBytes(userConfigText))), XDocument.Load(new MemoryStream(Encoding.UTF8.GetBytes(testHostConfigText)))); } diff --git a/test/testhost.UnitTests/Program.cs b/test/testhost.UnitTests/Program.cs index a68294ce79..f51a7b7fe2 100644 --- a/test/testhost.UnitTests/Program.cs +++ b/test/testhost.UnitTests/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. namespace testhost.UnitTests -{ +{ public static class Program { public static void Main(string[] args) diff --git a/test/vstest.console.UnitTests/CommandLine/CommandLineOptionsTests.cs b/test/vstest.console.UnitTests/CommandLine/CommandLineOptionsTests.cs index aab762a707..e35d8919f1 100644 --- a/test/vstest.console.UnitTests/CommandLine/CommandLineOptionsTests.cs +++ b/test/vstest.console.UnitTests/CommandLine/CommandLineOptionsTests.cs @@ -60,7 +60,7 @@ public void CommandLineOptionsGetForHasPhoneContextPropertyIfTargetDeviceIsSetRe CommandLineOptions.Instance.TargetDevice = "TargetDevice"; Assert.IsTrue(CommandLineOptions.Instance.HasPhoneContext); } - + [TestMethod] public void CommandLineOptionsAddSourceShouldThrowCommandLineExceptionForNullSource() { @@ -78,7 +78,7 @@ public void CommandLineOptionsAddSourceShouldConvertRelativePathToAbsolutePath() CommandLineOptions.Instance.AddSource(relativeTestFilePath); Assert.IsTrue(CommandLineOptions.Instance.Sources.Contains(absolutePath)); } - + [TestMethod] public void CommandLineOptionsAddSourceShouldThrowCommandLineExceptionForInvalidSource() { @@ -90,9 +90,9 @@ public void CommandLineOptionsAddSourceShouldAddSourceForValidSource() { string testFilePath = "C:\\DummyTestFile.txt"; this.fileHelper.Setup(fh => fh.Exists(testFilePath)).Returns(true); - + CommandLineOptions.Instance.AddSource(testFilePath); - + Assert.IsTrue(CommandLineOptions.Instance.Sources.Contains(testFilePath)); } } diff --git a/test/vstest.console.UnitTests/CommandLine/TestRunResultAggregatorTests.cs b/test/vstest.console.UnitTests/CommandLine/TestRunResultAggregatorTests.cs index a062392f3f..691d79025a 100644 --- a/test/vstest.console.UnitTests/CommandLine/TestRunResultAggregatorTests.cs +++ b/test/vstest.console.UnitTests/CommandLine/TestRunResultAggregatorTests.cs @@ -74,7 +74,7 @@ public void TestRunCompletionHandlerForTestRunStatsWithOneOrMoreFailingTestsSets var testOutcomeDict = new System.Collections.Generic.Dictionary(); testOutcomeDict.Add(TestOutcome.Failed, 1); var stats = new TestableTestRunStats(testOutcomeDict); - + var messageArgs = new TestRunCompleteEventArgs(stats, false, false, null, null, new TimeSpan()); this.mockTestRunRequest.Raise(tr => tr.OnRunCompletion += null, messageArgs); Assert.AreEqual(TestOutcome.Failed, resultAggregator.Outcome); @@ -104,7 +104,7 @@ public void TestRunCompletionHandlerForAbortedRunShouldSetsOutcomeToFailed() Assert.AreEqual(TestOutcome.Failed, resultAggregator.Outcome); } - #region implementation + #region Implementation private class TestableTestRunStats : ITestRunStatistics { diff --git a/test/vstest.console.UnitTests/ExceptionUtilities.cs b/test/vstest.console.UnitTests/ExceptionUtilities.cs index 082a93e311..e9e6839bea 100644 --- a/test/vstest.console.UnitTests/ExceptionUtilities.cs +++ b/test/vstest.console.UnitTests/ExceptionUtilities.cs @@ -8,7 +8,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests using Microsoft.VisualStudio.TestTools.UnitTesting; /// - /// This only exists because there is an issue with MSTest v2 and ThrowsException with a message API. + /// This only exists because there is an issue with MSTest v2 and ThrowsException with a message API. /// Move to Assert.ThrowException() with a message once the bug is fixed. /// public static class ExceptionUtilities diff --git a/test/vstest.console.UnitTests/Internal/ConsoleLoggerTests.cs b/test/vstest.console.UnitTests/Internal/ConsoleLoggerTests.cs index 6a81703f9d..9ec0a0de6e 100644 --- a/test/vstest.console.UnitTests/Internal/ConsoleLoggerTests.cs +++ b/test/vstest.console.UnitTests/Internal/ConsoleLoggerTests.cs @@ -1141,9 +1141,6 @@ private void Setup() return testresultList; } - - - private List GetTestResultObject(TestOutcome outcome) { var testcase = new TestCase("TestName", new Uri("some://uri"), "TestSource"); diff --git a/test/vstest.console.UnitTests/Internal/FilePatternParserTests.cs b/test/vstest.console.UnitTests/Internal/FilePatternParserTests.cs index 9d38cd2370..d0bf2e2fb2 100644 --- a/test/vstest.console.UnitTests/Internal/FilePatternParserTests.cs +++ b/test/vstest.console.UnitTests/Internal/FilePatternParserTests.cs @@ -106,7 +106,7 @@ public void FilePatternParserShouldThrowCommandLineExceptionIfFileDoesNotExist() var patternMatchingResult = new PatternMatchingResult(new List()); this.mockFileHelper.Setup(x => x.Exists(@"E:\path\to\project\tests\Blame.Tests\\abc.Tests.dll")).Returns(false); this.mockMatcherHelper.Setup(x => x.Execute(It.IsAny())).Returns(patternMatchingResult); - + Assert.ThrowsException(() => this.filePatternParser.GetMatchingFiles(@"E:\path\to\project\tests\Blame.Tests\\abc.Tests.dll")); } } diff --git a/test/vstest.console.UnitTests/Internal/ProgressIndicatorTests.cs b/test/vstest.console.UnitTests/Internal/ProgressIndicatorTests.cs index 546255ed27..9097d0ee5c 100644 --- a/test/vstest.console.UnitTests/Internal/ProgressIndicatorTests.cs +++ b/test/vstest.console.UnitTests/Internal/ProgressIndicatorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.Internal diff --git a/test/vstest.console.UnitTests/Processors/ListTestsTargetPathArgumentProcessorTests.cs b/test/vstest.console.UnitTests/Processors/ListTestsTargetPathArgumentProcessorTests.cs index 5ceeaef4c4..2f536e93af 100644 --- a/test/vstest.console.UnitTests/Processors/ListTestsTargetPathArgumentProcessorTests.cs +++ b/test/vstest.console.UnitTests/Processors/ListTestsTargetPathArgumentProcessorTests.cs @@ -33,7 +33,7 @@ public void CapabilitiesShouldAppropriateProperties() { ListTestsTargetPathArgumentProcessorCapabilities capabilities = new ListTestsTargetPathArgumentProcessorCapabilities(); Assert.AreEqual("/ListTestsTargetPath", capabilities.CommandName); - + Assert.AreEqual(false, capabilities.IsAction); Assert.AreEqual(ArgumentProcessorPriority.Normal, capabilities.Priority); diff --git a/test/vstest.console.UnitTests/Processors/RunSettingsArgumentProcessorTests.cs b/test/vstest.console.UnitTests/Processors/RunSettingsArgumentProcessorTests.cs index b0181f8ee2..c159a12b34 100644 --- a/test/vstest.console.UnitTests/Processors/RunSettingsArgumentProcessorTests.cs +++ b/test/vstest.console.UnitTests/Processors/RunSettingsArgumentProcessorTests.cs @@ -313,7 +313,7 @@ public void InitializeShouldPreserveActualJapaneseString() [TestMethod] public void InitializeShouldSetInIsolataionToTrueIfEnvironmentVariablesSpecified() - { + { var settingsXml = @"C:\temp"; // Arrange. @@ -341,7 +341,7 @@ public void InitializeShouldSetInIsolataionToTrueIfEnvironmentVariablesSpecified public void InitializeShouldNotSetInIsolataionToTrueIfEnvironmentVariablesNotSpecified() { var settingsXml = @""; - + /// Arrange. var fileName = "C:\\temp\\r.runsettings"; diff --git a/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs b/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs index 878e7ecf97..f79ce6dfcb 100644 --- a/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs +++ b/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs @@ -63,8 +63,6 @@ public void ExecutorInitializeWithNullOrEmptyTestCaseFilterShouldThrowCommandLin } } - - [TestMethod] public void ExecutorInitializeWithValidTestCaseFilterShouldAddTestCaseFilterToCommandLineOptions() { diff --git a/test/vstest.console.UnitTests/Publisher/TextFileTelemetryPublisherTests.cs b/test/vstest.console.UnitTests/Publisher/TextFileTelemetryPublisherTests.cs index dc4a3e6f03..39fb8027eb 100644 --- a/test/vstest.console.UnitTests/Publisher/TextFileTelemetryPublisherTests.cs +++ b/test/vstest.console.UnitTests/Publisher/TextFileTelemetryPublisherTests.cs @@ -24,10 +24,10 @@ public void LogToFileShouldCreateDirectoryIfNotExists() dummyDictionary.Add("DummyMessage://", "DummyValue"); dummyDictionary.Add("Dummy2", "DummyValue2"); - // Act. + // Act. publishMetrics.LogToFile("dummyevent", dummyDictionary, mockFileHelper.Object); - // Verify. + // Verify. mockFileHelper.Verify(fh => fh.CreateDirectory(It.IsAny()), Times.Once); } @@ -40,10 +40,10 @@ public void LogToFileShouldWriteAllText() dummyDictionary.Add("DummyMessage://", "DummyValue"); dummyDictionary.Add("Dummy2", "DummyValue2"); - // Act. + // Act. publishMetrics.LogToFile("dummyevent", dummyDictionary, mockFileHelper.Object); - // Verify. + // Verify. mockFileHelper.Verify(fh => fh.WriteAllTextToFile(It.IsAny(), It.IsAny()), Times.Once); } } diff --git a/test/vstest.console.UnitTests/TestPlatformHelpers/TestRequestManagerTests.cs b/test/vstest.console.UnitTests/TestPlatformHelpers/TestRequestManagerTests.cs index 2486b81164..958d539f2b 100644 --- a/test/vstest.console.UnitTests/TestPlatformHelpers/TestRequestManagerTests.cs +++ b/test/vstest.console.UnitTests/TestPlatformHelpers/TestRequestManagerTests.cs @@ -6,2222 +6,2222 @@ namespace vstest.console.UnitTests.TestPlatformHelpers { - using System; - using System.Collections.Generic; - using System.Diagnostics; - using System.Linq; - using System.Threading; - using System.Threading.Tasks; - - using Microsoft.VisualStudio.TestPlatform.Client.RequestHelper; - using Microsoft.VisualStudio.TestPlatform.CommandLine; - using Microsoft.VisualStudio.TestPlatform.CommandLine.Processors; - using Microsoft.VisualStudio.TestPlatform.CommandLine.Publisher; - using Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers; - using Microsoft.VisualStudio.TestPlatform.Common.Interfaces; - using Microsoft.VisualStudio.TestPlatform.Common.Logging; - using Microsoft.VisualStudio.TestPlatform.Common.Telemetry; - using Microsoft.VisualStudio.TestPlatform.CoreUtilities.Tracing.Interfaces; - using Microsoft.VisualStudio.TestPlatform.ObjectModel; - using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; - using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.Interfaces; - using Microsoft.VisualStudio.TestTools.UnitTesting; - - using System.Runtime.Versioning; - using Microsoft.VisualStudio.TestPlatform.CommandLineUtilities; - - using Moq; - - using vstest.console.UnitTests.TestDoubles; - using Microsoft.VisualStudio.TestPlatform.Utilities; - using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - - [TestClass] - public class TestRequestManagerTests - { - private DummyLoggerEvents mockLoggerEvents; - private CommandLineOptions commandLineOptions; - private Mock mockTestPlatform; - private Mock mockOutput; - private Mock mockDiscoveryRequest; - private Mock mockRunRequest; - private Mock mockAssemblyMetadataProvider; - private InferHelper inferHelper; - private ITestRequestManager testRequestManager; - private Mock mockTestPlatformEventSource; - private Mock mockRequestData; - private Mock mockMetricsCollection; - private ProtocolConfig protocolConfig; - private Task mockMetricsPublisherTask; - private Mock mockMetricsPublisher; - private Mock mockProcessHelper; - - private const string DefaultRunsettings = @" - - - - "; - - public TestRequestManagerTests() - { - this.mockLoggerEvents = new DummyLoggerEvents(TestSessionMessageLogger.Instance); - this.commandLineOptions = new DummyCommandLineOptions(); - this.mockOutput = new Mock(); - this.mockTestPlatform = new Mock(); - this.mockDiscoveryRequest = new Mock(); - this.mockRunRequest = new Mock(); - this.mockTestPlatformEventSource = new Mock(); - this.protocolConfig = new ProtocolConfig(); - this.mockAssemblyMetadataProvider = new Mock(); - this.inferHelper = new InferHelper(this.mockAssemblyMetadataProvider.Object); - var testRunResultAggregator = new DummyTestRunResultAggregator(); - this.mockProcessHelper = new Mock(); - - this.mockMetricsPublisher = new Mock(); - this.mockMetricsPublisherTask = Task.FromResult(this.mockMetricsPublisher.Object); - this.testRequestManager = new TestRequestManager( - this.commandLineOptions, - this.mockTestPlatform.Object, - testRunResultAggregator, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - this.mockMetricsCollection = new Mock(); - this.mockRequestData = new Mock(); - this.mockRequestData.Setup(rd => rd.MetricsCollection).Returns(this.mockMetricsCollection.Object); - this.mockTestPlatform.Setup(tp => tp.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) - .Returns(this.mockDiscoveryRequest.Object); - this.mockTestPlatform.Setup(tp => tp.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())) - .Returns(this.mockRunRequest.Object); - this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) - .Returns(Architecture.X86); - this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) - .Returns(new FrameworkName(Constants.DotNetFramework40)); - this.mockProcessHelper.Setup(x => x.GetCurrentProcessId()).Returns(1234); - this.mockProcessHelper.Setup(x => x.GetProcessName(It.IsAny())).Returns("dotnet.exe"); - } - - [TestCleanup] - public void Cleanup() - { - CommandLineOptions.Instance.Reset(); - - // Opt out the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "0"); - } - - [TestMethod] - public void TestRequestManagerShouldNotInitializeConsoleLoggerIfDesignModeIsSet() - { - CommandLineOptions.Instance.IsDesignMode = true; - this.mockLoggerEvents = new DummyLoggerEvents(TestSessionMessageLogger.Instance); - var requestManager = new TestRequestManager(CommandLineOptions.Instance, - new Mock().Object, - TestRunResultAggregator.Instance, - new Mock().Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - Assert.IsFalse(this.mockLoggerEvents.EventsSubscribed()); - } - - [TestMethod] - public void InitializeExtensionsShouldCallTestPlatformToClearAndUpdateExtensions() - { - var paths = new List() { "a", "b" }; - this.testRequestManager.InitializeExtensions(paths, false); - - this.mockTestPlatform.Verify(mt => mt.ClearExtensions(), Times.Once); - this.mockTestPlatform.Verify(mt => mt.UpdateExtensions(paths, false), Times.Once); - } - - [TestMethod] - public void ResetShouldResetCommandLineOptionsInstance() - { - var oldInstance = CommandLineOptions.Instance; - this.testRequestManager.ResetOptions(); - - var newInstance = CommandLineOptions.Instance; - - Assert.AreNotEqual(oldInstance, newInstance, "CommandLineOptions must be cleaned up"); - } - - [TestMethod] - public void DiscoverTestsShouldReadTheBatchSizeFromSettingsAndSetItForDiscoveryCriteria() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a" }, - RunSettings = - @" - - - 15 - - " - }; - - DiscoveryCriteria actualDiscoveryCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => - { - actualDiscoveryCriteria = discoveryCriteria; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager.DiscoverTests(payload, new Mock().Object, this.protocolConfig); - Assert.AreEqual(15, actualDiscoveryCriteria.FrequencyOfDiscoveredTestsEvent); - } - - [TestMethod] - public void DiscoverTestsShouldCallTestPlatformAndSucceed() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = DefaultRunsettings - }; - - var createDiscoveryRequestCalled = 0; - DiscoveryCriteria actualDiscoveryCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => - { - createDiscoveryRequestCalled++; - actualDiscoveryCriteria = discoveryCriteria; - }).Returns(mockDiscoveryRequest.Object); - - var mockDiscoveryRegistrar = new Mock(); - - string testCaseFilterValue = "TestFilter"; - CommandLineOptions.Instance.TestCaseFilterValue = testCaseFilterValue; - this.testRequestManager = new TestRequestManager(CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, this.protocolConfig); - - Assert.AreEqual(testCaseFilterValue, actualDiscoveryCriteria.TestCaseFilter, "TestCaseFilter must be set"); - - Assert.AreEqual(createDiscoveryRequestCalled, 1, "CreateDiscoveryRequest must be invoked only once."); - Assert.AreEqual(2, actualDiscoveryCriteria.Sources.Count(), "All Sources must be used for discovery request"); - Assert.AreEqual("a", actualDiscoveryCriteria.Sources.First(), "First Source in list is incorrect"); - Assert.AreEqual("b", actualDiscoveryCriteria.Sources.ElementAt(1), "Second Source in list is incorrect"); - - // Default frequency is set to 10, unless specified in runsettings. - Assert.AreEqual(10, actualDiscoveryCriteria.FrequencyOfDiscoveredTestsEvent); - - mockDiscoveryRegistrar.Verify(md => md.RegisterDiscoveryEvents(It.IsAny()), Times.Once); - mockDiscoveryRegistrar.Verify(md => md.UnregisterDiscoveryEvents(It.IsAny()), Times.Once); - - mockDiscoveryRequest.Verify(md => md.DiscoverAsync(), Times.Once); - - mockTestPlatformEventSource.Verify(mt => mt.DiscoveryRequestStart(), Times.Once); - mockTestPlatformEventSource.Verify(mt => mt.DiscoveryRequestStop(), Times.Once); - } - - [TestMethod] - public void DiscoverTestsShouldPassSameProtocolConfigInRequestData() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = DefaultRunsettings - }; - - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); - - var mockDiscoveryRegistrar = new Mock(); - - string testCaseFilterValue = "TestFilter"; - CommandLineOptions.Instance.TestCaseFilterValue = testCaseFilterValue; - this.testRequestManager = new TestRequestManager(CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - // Act - this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); - - // Verify. - Assert.AreEqual(4, actualRequestData.ProtocolConfig.Version); - } - - - [TestMethod] - public void DiscoverTestsShouldCollectMetrics() - { - // Opt in the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); - - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a.dll", "b.dll" }, - RunSettings = @" - - 2 - x86 - Framework35 - True - - - 169.254.193.190 - - " - }; - - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - var mockDiscoveryRegistrar = new Mock(); - - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager = new TestRequestManager( - CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - - // Act - this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); - - // Verify. - object targetDevice, maxcount, targetPlatform, disableAppDomain; - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetDevice, out targetDevice)); - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.MaxCPUcount, out maxcount)); - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetPlatform, out targetPlatform)); - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.DisableAppDomain, out disableAppDomain)); - Assert.AreEqual("Other", targetDevice); - Assert.AreEqual(2, maxcount); - Assert.AreEqual("X86", targetPlatform.ToString()); - Assert.AreEqual(true, disableAppDomain); - } - - [TestMethod] - public void DiscoverTestsShouldCollectTargetDeviceLocalMachineIfTargetDeviceStringisEmpty() - { - // Opt in the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); - - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = @" - - - - " - }; - - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - var mockDiscoveryRegistrar = new Mock(); - - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager = new TestRequestManager( - CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - - // Act - this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); - - // Verify. - object targetDevice; - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetDevice, out targetDevice)); - Assert.AreEqual("Local Machine", targetDevice); - } - - [TestMethod] - public void DiscoverTestsShouldCollectTargetDeviceIfTargetDeviceIsDevice() - { - // Opt in the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); - - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = @" - - Device - - " - }; - - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - var mockDiscoveryRegistrar = new Mock(); - - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager = new TestRequestManager( - CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - - // Act - this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); - - // Verify. - object targetDevice; - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetDevice, out targetDevice)); - Assert.AreEqual("Device", targetDevice); - } - - [TestMethod] - public void DiscoverTestsShouldCollectTargetDeviceIfTargetDeviceIsEmulator() - { - // Opt in the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); - - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = @" - - Emulator 8.1 U1 WVGA 4 inch 512MB - - " - }; - - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - var mockDiscoveryRegistrar = new Mock(); - - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager = new TestRequestManager( - CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - - // Act - this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); - - // Verify. - object targetDevice; - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetDevice, out targetDevice)); - Assert.AreEqual("Emulator 8.1 U1 WVGA 4 inch 512MB", targetDevice); - } - - [TestMethod] - public void DiscoverTestsShouldCollectCommands() - { - // Opt in the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); - - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = @" - - Device - - " - }; - - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - var mockDiscoveryRegistrar = new Mock(); - - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager = new TestRequestManager( - CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - CommandLineOptions.Instance.Parallel = true; - CommandLineOptions.Instance.EnableCodeCoverage = true; - CommandLineOptions.Instance.InIsolation = true; - CommandLineOptions.Instance.UseVsixExtensions = true; - CommandLineOptions.Instance.SettingsFile = @"c://temp/.runsettings"; - - // Act - this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); - - // Verify - object commandLineSwitches; - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.CommandLineSwitches, out commandLineSwitches)); - - var commandLineArray = commandLineSwitches.ToString(); - - Assert.IsTrue(commandLineArray.Contains("/Parallel")); - Assert.IsTrue(commandLineArray.Contains("/EnableCodeCoverage")); - Assert.IsTrue(commandLineArray.Contains("/InIsolation")); - Assert.IsTrue(commandLineArray.Contains("/UseVsixExtensions")); - Assert.IsTrue(commandLineArray.Contains("/settings//.RunSettings")); - } - - [TestMethod] - public void DiscoverTestsShouldCollectTestSettings() - { - // Opt in the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); - - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = @" - - Device - - " - }; - - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - var mockDiscoveryRegistrar = new Mock(); - - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager = new TestRequestManager( - CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - CommandLineOptions.Instance.SettingsFile = @"c://temp/.testsettings"; - - // Act - this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); - - // Verify - object commandLineSwitches; - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.CommandLineSwitches, out commandLineSwitches)); - - var commandLineArray = commandLineSwitches.ToString(); - - Assert.IsTrue(commandLineArray.Contains("/settings//.TestSettings")); - } - - [TestMethod] - public void DiscoverTestsShouldCollectVsmdiFile() - { - // Opt in the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); - - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = @" - - Device - - " - }; - - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - var mockDiscoveryRegistrar = new Mock(); - - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager = new TestRequestManager( - CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - CommandLineOptions.Instance.SettingsFile = @"c://temp/.vsmdi"; - - // Act - this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); - - // Verify - object commandLineSwitches; - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.CommandLineSwitches, out commandLineSwitches)); - - var commandLineArray = commandLineSwitches.ToString(); - - Assert.IsTrue(commandLineArray.Contains("/settings//.vsmdi")); - } - - [TestMethod] - public void DiscoverTestsShouldCollectTestRunConfigFile() - { - // Opt in the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); - - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = @" - - Device - - " - }; - - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - var mockDiscoveryRegistrar = new Mock(); - - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager = new TestRequestManager( - CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - CommandLineOptions.Instance.SettingsFile = @"c://temp/.testrunConfig"; - - // Act - this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); - - // Verify - object commandLineSwitches; - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.CommandLineSwitches, out commandLineSwitches)); - - var commandLineArray = commandLineSwitches.ToString(); - - Assert.IsTrue(commandLineArray.Contains("/settings//.testrunConfig")); - } - - [TestMethod] - public void DiscoverTestsShouldUpdateFrameworkAndPlatformIfNotSpecifiedInDesignMode() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - - " - }; - this.commandLineOptions.IsDesignMode = true; - this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) - .Returns(Architecture.ARM); - this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) - .Returns(new FrameworkName(Constants.DotNetFramework46)); - DiscoveryCriteria actualDiscoveryCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => - { - actualDiscoveryCriteria = discoveryCriteria; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager.DiscoverTests(payload, new Mock().Object, this.protocolConfig); - - this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny())); - this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny())); - - Assert.IsTrue(actualDiscoveryCriteria.RunSettings.Contains(Constants.DotNetFramework46)); - Assert.IsTrue(actualDiscoveryCriteria.RunSettings.Contains(Architecture.ARM.ToString())); - } - - [TestMethod] - public void DiscoverTestsShouldNotUpdateFrameworkAndPlatformIfSpecifiedInDesignMode() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a" }, - RunSettings = - $@" - - - {Constants.DotNetFramework46} - {Architecture.ARM.ToString()} - - " - }; - this.commandLineOptions.IsDesignMode = true; - this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) - .Returns(Architecture.X86); - this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) - .Returns(new FrameworkName(Constants.DotNetFramework451)); - DiscoveryCriteria actualDiscoveryCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => - { - actualDiscoveryCriteria = discoveryCriteria; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager.DiscoverTests(payload, new Mock().Object, this.protocolConfig); - - this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny()), Times.Never); - this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny()), Times.Never); - - Assert.IsTrue(actualDiscoveryCriteria.RunSettings.Contains(Constants.DotNetFramework46)); - Assert.IsTrue(actualDiscoveryCriteria.RunSettings.Contains(Architecture.ARM.ToString())); - } - - [TestMethod] - public void DiscoverTestsShouldUpdateFrameworkAndPlatformInCommandLineScenariosIfNotSpecified() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - - " - }; - this.commandLineOptions.IsDesignMode = false; - this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) - .Returns(Architecture.ARM); - this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) - .Returns(new FrameworkName(Constants.DotNetFramework46)); - DiscoveryCriteria actualDiscoveryCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => - { - actualDiscoveryCriteria = discoveryCriteria; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager.DiscoverTests(payload, new Mock().Object, this.protocolConfig); - this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny())); - this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny())); - - Assert.IsTrue(actualDiscoveryCriteria.RunSettings.Contains(Constants.DotNetFramework46)); - Assert.IsTrue(actualDiscoveryCriteria.RunSettings.Contains(Architecture.ARM.ToString())); - } - - [TestMethod] - public void DiscoverTestsShouldNotUpdateFrameworkAndPlatformInCommandLineScenariosIfSpecifiedButInferred() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - - " - }; - this.commandLineOptions.IsDesignMode = false; - this.commandLineOptions.TargetFrameworkVersion = Framework.DefaultFramework; - this.commandLineOptions.TargetArchitecture = Architecture.X86; - this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) - .Returns(Architecture.ARM); - this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) - .Returns(new FrameworkName(Constants.DotNetFramework46)); - DiscoveryCriteria actualDiscoveryCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform - .Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) - .Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => - { - actualDiscoveryCriteria = discoveryCriteria; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager.DiscoverTests(payload, - new Mock().Object, this.protocolConfig); - this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny()), Times.Once); - this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny()), Times.Once); - - Assert.IsFalse(actualDiscoveryCriteria.RunSettings.Contains(Constants.DotNetFramework46)); - Assert.IsFalse(actualDiscoveryCriteria.RunSettings.Contains(Architecture.ARM.ToString())); - } - - [TestMethod] - public void DiscoverTestsShouldPublishMetrics() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a", "b" } - }; - var mockProtocolConfig = new ProtocolConfig { Version = 2 }; - var mockDiscoveryRegistrar = new Mock(); - - // Act - this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); - - // Verify. - this.mockMetricsPublisher.Verify(mp => mp.PublishMetrics(TelemetryDataConstants.TestDiscoveryCompleteEvent, It.IsAny>()), Times.Once); - } - - [TestMethod] - public void CancelShouldNotThrowExceptionIfTestRunRequestHasBeenDisposed() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = DefaultRunsettings - }; - - var mockRunEventsRegistrar = new Mock(); - var mockCustomlauncher = new Mock(); - - this.testRequestManager.RunTests(payload, mockCustomlauncher.Object, mockRunEventsRegistrar.Object, this.protocolConfig); - this.testRequestManager.CancelTestRun(); - } - - [TestMethod] - public void AbortShouldNotThrowExceptionIfTestRunRequestHasBeenDisposed() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = DefaultRunsettings - }; - - var mockRunEventsRegistrar = new Mock(); - var mockCustomlauncher = new Mock(); - - this.testRequestManager.RunTests(payload, mockCustomlauncher.Object, mockRunEventsRegistrar.Object, this.protocolConfig); - this.testRequestManager.AbortTestRun(); - } - - [TestMethod] - public void RunTestsShouldReadTheBatchSizeFromSettingsAndSetItForTestRunCriteria() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a" }, - RunSettings = - @" - - - 15 - - " - }; - - TestRunCriteria actualTestRunCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - Assert.AreEqual(15, actualTestRunCriteria.FrequencyOfRunStatsChangeEvent); - } - - [TestMethod] - public void RunTestsShouldNotThrowForFramework35() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - Framework35 - - " - }; - - TestRunCriteria actualTestRunCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockDiscoveryRequest.Object); - this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())).Returns(new FrameworkName(Constants.DotNetFramework35)); - - var mockRunEventsRegistrar = new Mock(); - var mockCustomlauncher = new Mock(); - - this.testRequestManager.RunTests(payload, mockCustomlauncher.Object, mockRunEventsRegistrar.Object, this.protocolConfig); - - mockRunEventsRegistrar.Verify(lw => lw.LogWarning("Framework35 is not supported. For projects targeting .Net Framework 3.5, test will run in CLR 4.0 \"compatibility mode\"."), Times.Once); - mockTestPlatformEventSource.Verify(mt => mt.ExecutionRequestStart(), Times.Once); - mockTestPlatformEventSource.Verify(mt => mt.ExecutionRequestStop(), Times.Once); - } - - [TestMethod] - public void RunTestsShouldPassSameProtocolConfigInRequestData() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a" }, - RunSettings = DefaultRunsettings - }; - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualRequestData = requestData; - }).Returns(mockDiscoveryRequest.Object); - - // Act. - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, mockProtocolConfig); - - // Verify. - Assert.AreEqual(4, actualRequestData.ProtocolConfig.Version); - } - - [TestMethod] - public void RunTestsShouldCollectCommands() - { - // Opt in the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); - - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a" }, - RunSettings = DefaultRunsettings - }; - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualRequestData = requestData; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager = new TestRequestManager( - CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - CommandLineOptions.Instance.Parallel = true; - CommandLineOptions.Instance.EnableCodeCoverage = true; - CommandLineOptions.Instance.InIsolation = true; - CommandLineOptions.Instance.UseVsixExtensions = true; - CommandLineOptions.Instance.SettingsFile = @"c://temp/.runsettings"; - - // Act. - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, mockProtocolConfig); - - // Verify - object commandLineSwitches; - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.CommandLineSwitches, out commandLineSwitches)); - - var commandLineArray = commandLineSwitches.ToString(); - - Assert.IsTrue(commandLineArray.Contains("/Parallel")); - Assert.IsTrue(commandLineArray.Contains("/EnableCodeCoverage")); - Assert.IsTrue(commandLineArray.Contains("/InIsolation")); - Assert.IsTrue(commandLineArray.Contains("/UseVsixExtensions")); - Assert.IsTrue(commandLineArray.Contains("/settings//.RunSettings")); - } - - [TestMethod] - public void RunTestsShouldCollectTelemetryForLegacySettings() - { - // Opt in the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); - - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a" }, - RunSettings = @" - - - - - - - - - - - - - - - - " - }; - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualRequestData = requestData; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager = new TestRequestManager( - CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - // Act. - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, mockProtocolConfig); - - // Verify - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue("VS.TestRun.LegacySettings.Elements", out var legacySettingsNodes)); - StringAssert.Equals("Deployment, Scripts, Execution, AssemblyResolution, Timeouts, Hosts", legacySettingsNodes); - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue("VS.TestRun.LegacySettings.DeploymentAttributes", out var deploymentAttributes)); - StringAssert.Equals("enabled, deploySatelliteAssemblies", deploymentAttributes); - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue("VS.TestRun.LegacySettings.ExecutionAttributes", out var executionAttributes)); - StringAssert.Equals("hostProcessPlatform, parallelTestCount", executionAttributes); - - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TestSettingsUsed, out var testSettingsUsed)); - Assert.IsFalse((bool)testSettingsUsed); - } - - [TestMethod] - public void RunTestsShouldCollectTelemetryForTestSettingsEmbeddedInsideRunSettings() - { - // Opt in the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); - - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a" }, - RunSettings = @" - - true - ..\..\Foo.testsettings - - " - }; - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualRequestData = requestData; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager = new TestRequestManager( - CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - // Act. - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, mockProtocolConfig); - - // Verify - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TestSettingsUsed, out var testSettingsUsed)); - Assert.IsTrue((bool)testSettingsUsed); - } - - [TestMethod] - public void RunTestsShouldCollectMetrics() - { - // Opt in the Telemetry - Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); - - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = @" - - 2 - x86 - Framework35 - True - - - 169.254.193.190 - - " - }; - var mockProtocolConfig = new ProtocolConfig { Version = 4 }; - IRequestData actualRequestData = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualRequestData = requestData; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager = new TestRequestManager( - CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - // Act. - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, mockProtocolConfig); - - // Verify - object targetDevice, maxcount, targetPlatform, disableAppDomain; - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetDevice, out targetDevice)); - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.MaxCPUcount, out maxcount)); - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetPlatform, out targetPlatform)); - Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.DisableAppDomain, out disableAppDomain)); - Assert.AreEqual("Other", targetDevice); - Assert.AreEqual(2, maxcount); - Assert.AreEqual("X86", targetPlatform.ToString()); - Assert.AreEqual(true, disableAppDomain); - } - - [TestMethod] - public void RunTestsWithSourcesShouldCallTestPlatformAndSucceed() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = DefaultRunsettings - }; - - var createRunRequestCalled = 0; - TestRunCriteria observedCriteria = null; - var mockRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - createRunRequestCalled++; - observedCriteria = runCriteria; - }).Returns(mockRunRequest.Object); - - var mockRunEventsRegistrar = new Mock(); - var mockCustomlauncher = new Mock(); - - string testCaseFilterValue = "TestFilter"; - payload.TestPlatformOptions = new TestPlatformOptions { TestCaseFilter = testCaseFilterValue }; - this.testRequestManager = new TestRequestManager(CommandLineOptions.Instance, - this.mockTestPlatform.Object, - TestRunResultAggregator.Instance, - this.mockTestPlatformEventSource.Object, - this.inferHelper, - this.mockMetricsPublisherTask, - this.mockProcessHelper.Object); - - this.testRequestManager.RunTests(payload, mockCustomlauncher.Object, mockRunEventsRegistrar.Object, this.protocolConfig); - - Assert.AreEqual(testCaseFilterValue, observedCriteria.TestCaseFilter, "TestCaseFilter must be set"); - - Assert.AreEqual(createRunRequestCalled, 1, "CreateRunRequest must be invoked only once."); - Assert.AreEqual(2, observedCriteria.Sources.Count(), "All Sources must be used for discovery request"); - Assert.AreEqual("a", observedCriteria.Sources.First(), "First Source in list is incorrect"); - Assert.AreEqual("b", observedCriteria.Sources.ElementAt(1), "Second Source in list is incorrect"); - - // Check for the default value for the frequency - Assert.AreEqual(10, observedCriteria.FrequencyOfRunStatsChangeEvent); - mockRunEventsRegistrar.Verify(md => md.RegisterTestRunEvents(It.IsAny()), Times.Once); - mockRunEventsRegistrar.Verify(md => md.UnregisterTestRunEvents(It.IsAny()), Times.Once); - - mockRunRequest.Verify(md => md.ExecuteAsync(), Times.Once); - - mockTestPlatformEventSource.Verify(mt => mt.ExecutionRequestStart(), Times.Once); - mockTestPlatformEventSource.Verify(mt => mt.ExecutionRequestStop(), Times.Once); - } - - [TestMethod] - public void RunTestsMultipleCallsShouldNotRunInParallel() - { - var payload1 = new TestRunRequestPayload() - { - Sources = new List() { "a" }, - RunSettings = DefaultRunsettings - }; - - var payload2 = new TestRunRequestPayload() - { - Sources = new List() { "b" }, - RunSettings = DefaultRunsettings - }; - - var mockRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())) - .Returns(mockRunRequest.Object); - - var mockRunEventsRegistrar1 = new Mock(); - var mockRunEventsRegistrar2 = new Mock(); - - // Setup the second one to wait - var sw = new Stopwatch(); - sw.Start(); - - long run1Start = 0; - long run1Stop = 0; - long run2Start = 0; - long run2Stop = 0; - mockRunEventsRegistrar1.Setup(md => md.RegisterTestRunEvents(It.IsAny())).Callback(() => - { - Thread.Sleep(10); - run1Start = sw.ElapsedMilliseconds; - Thread.Sleep(1); - }); - mockRunEventsRegistrar1.Setup(md => md.UnregisterTestRunEvents(It.IsAny())).Callback(() => - { - Thread.Sleep(10); - run1Stop = sw.ElapsedMilliseconds; - Thread.Sleep(10); - }); - - mockRunEventsRegistrar2.Setup(md => md.RegisterTestRunEvents(It.IsAny())).Callback(() => - { - Thread.Sleep(10); - run2Start = sw.ElapsedMilliseconds; - Thread.Sleep(10); - }); - mockRunEventsRegistrar2.Setup(md => md.UnregisterTestRunEvents(It.IsAny())).Callback(() => - { - Thread.Sleep(10); - run2Stop = sw.ElapsedMilliseconds; - }); - - var mockCustomlauncher = new Mock(); - var task1 = Task.Run(() => - { - this.testRequestManager.RunTests(payload1, mockCustomlauncher.Object, mockRunEventsRegistrar1.Object, this.protocolConfig); - }); - var task2 = Task.Run(() => - { - this.testRequestManager.RunTests(payload2, mockCustomlauncher.Object, mockRunEventsRegistrar2.Object, this.protocolConfig); - }); - - Task.WaitAll(task1, task2); - - if (run1Start < run2Start) - { - Assert.IsTrue((run2Stop > run2Start) - && (run2Start > run1Stop) - && (run1Stop > run1Start)); - } - else - { - Assert.IsTrue((run1Stop > run1Start) - && (run1Start > run2Stop) - && (run2Stop > run2Start)); - } - } - - [TestMethod] - public void RunTestsShouldPublishMetrics() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = DefaultRunsettings - }; - - var mockRunEventsRegistrar = new Mock(); - var mockCustomlauncher = new Mock(); - - this.testRequestManager.RunTests(payload, mockCustomlauncher.Object, mockRunEventsRegistrar.Object, this.protocolConfig); - - this.mockMetricsPublisher.Verify(mp => mp.PublishMetrics(TelemetryDataConstants.TestExecutionCompleteEvent, It.IsAny>()), Times.Once); - } - - // TODO: add tests in design mode and executor that they are handling all the exceptions properly including printing inner exception. - - [TestMethod] - public void RunTestsIfThrowsTestPlatformExceptionShouldThrowOut() - { - Assert.ThrowsException(() => RunTestsIfThrowsExceptionShouldThrowOut(new TestPlatformException("HelloWorld"))); - } - - [TestMethod] - public void RunTestsIfThrowsSettingsExceptionShouldThrowOut() - { - Assert.ThrowsException(() => RunTestsIfThrowsExceptionShouldThrowOut(new SettingsException("HelloWorld"))); - } - - [TestMethod] - public void RunTestsIfThrowsInvalidOperationExceptionShouldThrowOut() - { - Assert.ThrowsException(() => RunTestsIfThrowsExceptionShouldThrowOut(new InvalidOperationException("HelloWorld"))); - } - - [TestMethod] - public void RunTestsIfThrowsExceptionShouldThrowOut() - { - Assert.ThrowsException(() => RunTestsIfThrowsExceptionShouldThrowOut(new NotImplementedException("HelloWorld"))); - } - - [TestMethod] - public void DiscoverTestsIfThrowsTestPlatformExceptionShouldThrowOut() - { - Assert.ThrowsException(() => DiscoverTestsIfThrowsExceptionShouldThrowOut(new TestPlatformException("HelloWorld"))); - } - - [TestMethod] - public void DiscoverTestsIfThrowsSettingsExceptionShouldThrowOut() - { - Assert.ThrowsException(() => DiscoverTestsIfThrowsExceptionShouldThrowOut(new SettingsException("HelloWorld"))); - } - - [TestMethod] - public void DiscoverTestsIfThrowsInvalidOperationExceptionShouldThrowOut() - { - Assert.ThrowsException(() => DiscoverTestsIfThrowsExceptionShouldThrowOut(new InvalidOperationException("HelloWorld"))); - } - - [TestMethod] - public void DiscoverTestsIfThrowsExceptionShouldThrowOut() - { - Assert.ThrowsException(() => DiscoverTestsIfThrowsExceptionShouldThrowOut(new NotImplementedException("HelloWorld"))); - } - - [DataTestMethod] - [DataRow(true)] - [DataRow(false)] - public void DiscoverTestsShouldUpdateDesignModeAndCollectSourceInformation(bool designModeValue) - { - var runsettings = ".NETFramework,Version=v4.5"; - var discoveryPayload = CreateDiscoveryPayload(runsettings); - this.commandLineOptions.IsDesignMode = designModeValue; - - this.testRequestManager.DiscoverTests(discoveryPayload, new Mock().Object, this.protocolConfig); - - var designmode = $"{designModeValue}"; - this.mockTestPlatform.Verify( - tp => tp.CreateDiscoveryRequest(It.IsAny(), It.Is(dc => dc.RunSettings.Contains(designmode)), It.IsAny())); - - var collectSourceInformation = $"{designModeValue}"; - this.mockTestPlatform.Verify( - tp => tp.CreateDiscoveryRequest(It.IsAny(), It.Is(dc => dc.RunSettings.Contains(collectSourceInformation)), It.IsAny())); - } - - [TestMethod] - public void DiscoverTestsShouldNotUpdateDesignModeIfUserHasSetDesignModeInRunSettings() - { - var runsettings = "False.NETFramework,Version=v4.5"; - var discoveryPayload = CreateDiscoveryPayload(runsettings); - this.commandLineOptions.IsDesignMode = true; - - this.testRequestManager.DiscoverTests(discoveryPayload, new Mock().Object, this.protocolConfig); - - var designmode = "False"; - this.mockTestPlatform.Verify( - tp => tp.CreateDiscoveryRequest(It.IsAny(), It.Is(dc => dc.RunSettings.Contains(designmode)), It.IsAny())); - } - - [DataTestMethod] - [DataRow(true)] - [DataRow(false)] - public void RunTestsShouldUpdateDesignModeIfRunnerIsInDesignMode(bool designModeValue) - { - var runsettings = - ".NETFramework,Version=v4.5"; - var payload = new TestRunRequestPayload - { - RunSettings = runsettings, - Sources = new List { "c:\\testproject.dll" } - }; - this.commandLineOptions.IsDesignMode = designModeValue; - - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - - var designmode = $"{designModeValue}"; - this.mockTestPlatform.Verify(tp => tp.CreateTestRunRequest(It.IsAny(), It.Is(rc => rc.TestRunSettings.Contains(designmode)), It.IsAny())); - } - - [DataTestMethod] - [DataRow(true)] - [DataRow(false)] - public void DiscoverTestsShouldNotUpdateCollectSourceInformationIfUserHasSetItInRunSettings(bool val) - { - var runsettings = $"{val}"; - var discoveryPayload = CreateDiscoveryPayload(runsettings); - - this.testRequestManager.DiscoverTests(discoveryPayload, new Mock().Object, this.protocolConfig); - - var collectSourceInformation = $"{val}"; - this.mockTestPlatform.Verify( - tp => tp.CreateDiscoveryRequest(It.IsAny(), It.Is(dc => dc.RunSettings.Contains(collectSourceInformation)), It.IsAny())); - } - - [TestMethod] - public void RunTestsShouldShouldUpdateFrameworkAndPlatformIfNotSpecifiedInDesignMode() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - - " - }; - - this.commandLineOptions.IsDesignMode = true; - this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) - .Returns(Architecture.ARM); - this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) - .Returns(new FrameworkName(Constants.DotNetFramework46)); - TestRunCriteria actualTestRunCriteria = null; - var mockTestRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockTestRunRequest.Object); - - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - - this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny())); - this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny())); - - Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Constants.DotNetFramework46)); - Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Architecture.ARM.ToString())); - - } - - [TestMethod] - public void RunTestsShouldNotUpdateFrameworkAndPlatformIfSpecifiedInDesignModeButInferred() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - $@" - - - {Constants.DotNetFramework46} - {Architecture.ARM.ToString()} - - " - }; - - this.commandLineOptions.IsDesignMode = true; - this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) - .Returns(Architecture.X86); - this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) - .Returns(new FrameworkName(Constants.DotNetFramework451)); - TestRunCriteria actualTestRunCriteria = null; - var mockTestRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockTestRunRequest.Object); - - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - - this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny()), Times.Once); - this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny()), Times.Once); - - Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Constants.DotNetFramework46)); - Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Architecture.ARM.ToString())); - } - - [TestMethod] - [DataRow("x86")] - [DataRow("X86")] - [DataRow("ARM")] - [DataRow("aRm")] - public void RunTestsShouldNotUpdatePlatformIfSpecifiedInDesignModeButInferred(string targetPlatform) - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - $@" - - - {targetPlatform} - - " - }; - - this.commandLineOptions.IsDesignMode = true; - this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) - .Returns(Architecture.X86); - this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) - .Returns(new FrameworkName(Constants.DotNetFramework451)); - TestRunCriteria actualTestRunCriteria = null; - var mockTestRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockTestRunRequest.Object); - - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - - this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny()), Times.Once); - this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny()), Times.Once); - - Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(targetPlatform)); - } - - [TestMethod] - public void RunTestsShouldUpdateFrameworkAndPlatformInCommandLineScenarios() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - - " - }; - - this.commandLineOptions.IsDesignMode = false; - this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) - .Returns(Architecture.ARM); - this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) - .Returns(new FrameworkName(Constants.DotNetFramework46)); - TestRunCriteria actualTestRunCriteria = null; - var mockTestRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockTestRunRequest.Object); - - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - - this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny())); - this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny())); - - Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Constants.DotNetFramework46)); - Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Architecture.ARM.ToString())); - } - - [TestMethod] - public void RunTestsShouldNotpdateFrameworkAndPlatformInCommandLineScenariosIfSpecifiedButInferred() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - - " - }; - - this.commandLineOptions.IsDesignMode = false; - this.commandLineOptions.TargetArchitecture = Architecture.X86; - this.commandLineOptions.TargetFrameworkVersion = Framework.DefaultFramework; - this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) - .Returns(Architecture.ARM); - this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) - .Returns(new FrameworkName(Constants.DotNetFramework46)); - TestRunCriteria actualTestRunCriteria = null; - var mockTestRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockTestRunRequest.Object); - - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - - this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny()), Times.Once); - this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny()), Times.Once); - - Assert.IsFalse(actualTestRunCriteria.TestRunSettings.Contains(Constants.DotNetFramework46)); - Assert.IsFalse(actualTestRunCriteria.TestRunSettings.Contains(Architecture.ARM.ToString())); - } - - [TestMethod] - public void RunTestsWithTestCasesShouldUpdateFrameworkAndPlatformIfNotSpecifiedInDesignMode() - { - var actualSources = new List() { "1.dll", "2.dll" }; - var payload = new TestRunRequestPayload() - { - TestCases = new List() { - new TestCase(){Source = actualSources[0]}, - new TestCase() { Source = actualSources[0]}, - new TestCase() { Source = actualSources[1] } - }, - RunSettings = - @" - - - - " - }; - - List archSources = new List(), fxSources = new List(); - - this.commandLineOptions.IsDesignMode = true; - this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())).Callback(source => archSources.Add(source)) - .Returns(Architecture.ARM); - this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())).Callback(source => fxSources.Add(source)) - .Returns(new FrameworkName(Constants.DotNetFramework46)); - TestRunCriteria actualTestRunCriteria = null; - var mockTestRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockTestRunRequest.Object); - - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - - this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny())); - this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny())); - - Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Constants.DotNetFramework46)); - Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Architecture.ARM.ToString())); - CollectionAssert.AreEqual(actualSources, archSources); - CollectionAssert.AreEqual(actualSources, fxSources); - } - - [TestMethod] - public void RunTestShouldThrowExceptionIfRunSettingWithDCHasTestSettingsInIt() - { - var settingXml = @" - - C:\temp.testsettings - true - - - - - - - - - - "; - - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = settingXml - }; - - this.commandLineOptions.EnableCodeCoverage = false; - bool exceptionThrown = false; - - try - { - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - } - catch (SettingsException ex) - { - exceptionThrown = true; - Assert.IsTrue(ex.Message.Contains(@"C:\temp.testsettings"), ex.Message); - } - - Assert.IsTrue(exceptionThrown, "Initialize should throw exception"); - } - - [TestMethod] - public void RunTestShouldThrowExceptionIfRunSettingWithDCHasTestSettingsAndEnableCodeCoverageTrue() - { - var settingXml = @" - - C:\temp.testsettings - true - - - - - - - - - - "; - - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = settingXml - }; - - this.commandLineOptions.EnableCodeCoverage = true; - bool exceptionThrown = false; - - try - { - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - } - catch (SettingsException ex) - { - exceptionThrown = true; - Assert.IsTrue(ex.Message.Contains(@"C:\temp.testsettings"), ex.Message); - } - - Assert.IsTrue(exceptionThrown, "Initialize should throw exception"); - } - - [TestMethod] - public void RunTestShouldNotThrowExceptionIfRunSettingHasCodeCoverageDCAndTestSettingsInItWithEnableCoverageTrue() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = @" - - C:\temp.testsettings - true - - - - - - - - " - }; - - this.commandLineOptions.EnableCodeCoverage = true; - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - } - - [TestMethod] - public void RunTestsShouldAddConsoleLoggerInRunSettingsInNonDesignMode() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - - " - }; - - this.commandLineOptions.IsDesignMode = false; - TestRunCriteria actualTestRunCriteria = null; - var mockTestRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockTestRunRequest.Object); - - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - - var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualTestRunCriteria.TestRunSettings).LoggerSettingsList; - Assert.AreEqual(1, loggerSettingsList.Count); - Assert.AreEqual("Console", loggerSettingsList[0].FriendlyName); - Assert.IsNotNull(loggerSettingsList[0].AssemblyQualifiedName); - Assert.IsNotNull(loggerSettingsList[0].CodeBase); - } - - [TestMethod] - public void RunTestsShouldAddConsoleLoggerInRunSettingsIfDesignModeSetFalseInRunSettings() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - False - - - - - - Value1 - - - - - " - }; - - this.commandLineOptions.IsDesignMode = true; - TestRunCriteria actualTestRunCriteria = null; - var mockTestRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockTestRunRequest.Object); - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - - var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualTestRunCriteria.TestRunSettings).LoggerSettingsList; - Assert.AreEqual(2, loggerSettingsList.Count); - Assert.IsNotNull(loggerSettingsList[0].Configuration); - Assert.AreEqual("blabla", loggerSettingsList[0].FriendlyName); - Assert.AreEqual("Console", loggerSettingsList[1].FriendlyName); - Assert.IsNotNull(loggerSettingsList[1].AssemblyQualifiedName); - Assert.IsNotNull(loggerSettingsList[1].CodeBase); - } - - [TestMethod] - public void DiscoverTestsShouldAddConsoleLoggerInRunSettingsIfDesignModeSetFalseInRunSettings() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - False - - - - - - Value1 - - - - - " - }; - this.commandLineOptions.IsDesignMode = true; - DiscoveryCriteria actualDiscoveryCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform - .Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) - .Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => - { - actualDiscoveryCriteria = discoveryCriteria; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager.DiscoverTests(payload, - new Mock().Object, this.protocolConfig); - - var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualDiscoveryCriteria.RunSettings).LoggerSettingsList; - Assert.AreEqual(2, loggerSettingsList.Count); - Assert.IsNotNull(loggerSettingsList[0].Configuration); - Assert.AreEqual("blabla", loggerSettingsList[0].FriendlyName); - Assert.AreEqual("Console", loggerSettingsList[1].FriendlyName); - Assert.IsNotNull(loggerSettingsList[1].AssemblyQualifiedName); - Assert.IsNotNull(loggerSettingsList[1].CodeBase); - } - - [TestMethod] - public void RunTestsShouldNotAddConsoleLoggerInRunSettingsInDesignMode() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - True - - " - }; - - this.commandLineOptions.IsDesignMode = false; - TestRunCriteria actualTestRunCriteria = null; - var mockTestRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockTestRunRequest.Object); - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - - Assert.IsFalse(actualTestRunCriteria.TestRunSettings.Contains("LoggerRunSettings")); - } - - [TestMethod] - public void DiscoverTestsShouldAddConsoleLoggerInRunSettingsInNonDesignMode() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - - " - }; - this.commandLineOptions.IsDesignMode = false; - DiscoveryCriteria actualDiscoveryCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform - .Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) - .Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => - { - actualDiscoveryCriteria = discoveryCriteria; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager.DiscoverTests(payload, - new Mock().Object, this.protocolConfig); - - var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualDiscoveryCriteria.RunSettings).LoggerSettingsList; - Assert.AreEqual(1, loggerSettingsList.Count); - Assert.AreEqual("Console", loggerSettingsList[0].FriendlyName); - Assert.IsNotNull(loggerSettingsList[0].AssemblyQualifiedName); - Assert.IsNotNull(loggerSettingsList[0].CodeBase); - } - - [TestMethod] - public void DiscoverTestsShouldNotAddConsoleLoggerInRunSettingsInDesignMode() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - True - - " - }; - this.commandLineOptions.IsDesignMode = false; - DiscoveryCriteria actualDiscoveryCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform - .Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) - .Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => - { - actualDiscoveryCriteria = discoveryCriteria; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager.DiscoverTests(payload, - new Mock().Object, this.protocolConfig); - - Assert.IsFalse(actualDiscoveryCriteria.RunSettings.Contains("LoggerRunSettings")); - } - - [TestMethod] - public void RunTestsShouldOverrideOnlyAssemblyNameIfConsoleLoggerAlreadyPresentInNonDesignMode() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - False - - - - - - Value1 - - - - - Value1 - - - - - " - }; - - this.commandLineOptions.IsDesignMode = false; - TestRunCriteria actualTestRunCriteria = null; - var mockTestRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockTestRunRequest.Object); - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - - var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualTestRunCriteria.TestRunSettings).LoggerSettingsList; - Assert.AreEqual(2, loggerSettingsList.Count); - Assert.IsNotNull(loggerSettingsList[0].Configuration); - Assert.AreEqual("blabla", loggerSettingsList[0].FriendlyName); - Assert.AreEqual("console", loggerSettingsList[1].FriendlyName); - Assert.AreEqual(new Uri("logger://tempconsoleUri").ToString(), loggerSettingsList[1].Uri.ToString()); - Assert.AreNotEqual("tempAssemblyName", loggerSettingsList[1].AssemblyQualifiedName); - Assert.AreNotEqual("tempCodeBase", loggerSettingsList[1].CodeBase); - Assert.IsTrue(loggerSettingsList[1].Configuration.InnerXml.Contains("Value1")); - Assert.IsNotNull(loggerSettingsList[1].AssemblyQualifiedName); - Assert.IsNotNull(loggerSettingsList[1].CodeBase); - } - - [TestMethod] - public void DiscoverTestsShouldOverrideOnlyAssemblyNameIfConsoleLoggerAlreadyPresentInNonDesignMode() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - False - - - - - - Value1 - - - - - Value1 - - - - - " - }; - this.commandLineOptions.IsDesignMode = false; - DiscoveryCriteria actualDiscoveryCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform - .Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) - .Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => - { - actualDiscoveryCriteria = discoveryCriteria; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager.DiscoverTests(payload, - new Mock().Object, this.protocolConfig); - - var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualDiscoveryCriteria.RunSettings).LoggerSettingsList; - Assert.AreEqual(2, loggerSettingsList.Count); - Assert.IsNotNull(loggerSettingsList[0].Configuration); - Assert.AreEqual("blabla", loggerSettingsList[0].FriendlyName); - Assert.AreEqual("consoleTemp", loggerSettingsList[1].FriendlyName); - Assert.AreEqual(new Uri("logger://Microsoft/TestPlatform/ConsoleLogger/v1").ToString(), loggerSettingsList[1].Uri.ToString()); - Assert.AreNotEqual("tempAssemblyName", loggerSettingsList[1].AssemblyQualifiedName); - Assert.AreNotEqual("tempAssemblyName", loggerSettingsList[1].CodeBase); - Assert.IsTrue(loggerSettingsList[1].Configuration.InnerXml.Contains("Value1")); - Assert.IsNotNull(loggerSettingsList[1].AssemblyQualifiedName); - Assert.IsNotNull(loggerSettingsList[1].CodeBase); - } - - [TestMethod] - public void RunTestsShouldOverrideOnlyAssemblyNameIfConsoleLoggerAlreadyPresentInDesignMode() - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - True - - - - - - Value1 - - - - - Value1 - - - - - " - }; - - this.commandLineOptions.IsDesignMode = false; - TestRunCriteria actualTestRunCriteria = null; - var mockTestRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - actualTestRunCriteria = runCriteria; - }).Returns(mockTestRunRequest.Object); - this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); - - var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualTestRunCriteria.TestRunSettings).LoggerSettingsList; - Assert.AreEqual(2, loggerSettingsList.Count); - Assert.IsNotNull(loggerSettingsList[0].Configuration); - Assert.AreEqual("blabla", loggerSettingsList[0].FriendlyName); - Assert.AreEqual("console", loggerSettingsList[1].FriendlyName); - Assert.AreEqual(new Uri("logger://tempconsoleUri").ToString(), loggerSettingsList[1].Uri.ToString()); - Assert.AreNotEqual("tempAssemblyName", loggerSettingsList[1].AssemblyQualifiedName); - Assert.AreNotEqual("tempCodeBase", loggerSettingsList[1].CodeBase); - Assert.IsTrue(loggerSettingsList[1].Configuration.InnerXml.Contains("Value1")); - Assert.IsNotNull(loggerSettingsList[1].AssemblyQualifiedName); - Assert.IsNotNull(loggerSettingsList[1].CodeBase); - } - - [TestMethod] - public void DiscoverTestsShouldOverrideOnlyAssemblyNameIfConsoleLoggerAlreadyPresentInDesignMode() - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a.dll" }, - RunSettings = - @" - - - True - - - - - - Value1 - - - - - Value1 - - - - - " - }; - this.commandLineOptions.IsDesignMode = false; - DiscoveryCriteria actualDiscoveryCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform - .Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) - .Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => - { - actualDiscoveryCriteria = discoveryCriteria; - }).Returns(mockDiscoveryRequest.Object); - - this.testRequestManager.DiscoverTests(payload, - new Mock().Object, this.protocolConfig); - - var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualDiscoveryCriteria.RunSettings).LoggerSettingsList; - Assert.AreEqual(2, loggerSettingsList.Count); - Assert.IsNotNull(loggerSettingsList[0].Configuration); - Assert.AreEqual("blabla", loggerSettingsList[0].FriendlyName); - Assert.AreEqual("consoleTemp", loggerSettingsList[1].FriendlyName); - Assert.AreEqual(new Uri("logger://Microsoft/TestPlatform/ConsoleLogger/v1").ToString(), loggerSettingsList[1].Uri.ToString()); - Assert.AreNotEqual("tempAssemblyName", loggerSettingsList[1].AssemblyQualifiedName); - Assert.AreNotEqual("tempAssemblyName", loggerSettingsList[1].CodeBase); - Assert.IsTrue(loggerSettingsList[1].Configuration.InnerXml.Contains("Value1")); - Assert.IsNotNull(loggerSettingsList[1].AssemblyQualifiedName); - Assert.IsNotNull(loggerSettingsList[1].CodeBase); - } - - private static DiscoveryRequestPayload CreateDiscoveryPayload(string runsettings) - { - var discoveryPayload = new DiscoveryRequestPayload - { - RunSettings = runsettings, - Sources = new[] { "c:\\testproject.dll" } - }; - return discoveryPayload; - } - - private void RunTestsIfThrowsExceptionShouldThrowOut(Exception exception) - { - var payload = new TestRunRequestPayload() - { - Sources = new List() { "a", "b" }, - RunSettings = DefaultRunsettings - }; - - var createRunRequestCalled = 0; - TestRunCriteria observedCriteria = null; - var mockRunRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => - { - createRunRequestCalled++; - observedCriteria = runCriteria; - }).Returns(mockRunRequest.Object); - - mockRunRequest.Setup(mr => mr.ExecuteAsync()).Throws(exception); - - var mockRunEventsRegistrar = new Mock(); - var mockCustomlauncher = new Mock(); - - this.testRequestManager.RunTests(payload, mockCustomlauncher.Object, mockRunEventsRegistrar.Object, this.protocolConfig); - } - - private void DiscoverTestsIfThrowsExceptionShouldThrowOut(Exception exception) - { - var payload = new DiscoveryRequestPayload() - { - Sources = new List() { "a.dll", "b.dll" }, - RunSettings = DefaultRunsettings - }; - - DiscoveryCriteria observedCriteria = null; - var mockDiscoveryRequest = new Mock(); - this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( - (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => - { - observedCriteria = discoveryCriteria; - }).Returns(mockDiscoveryRequest.Object); - - mockDiscoveryRequest.Setup(mr => mr.DiscoverAsync()).Throws(exception); - - var mockDiscoveryEventsRegistrar = new Mock(); - var mockCustomlauncher = new Mock(); - - this.testRequestManager.DiscoverTests(payload, mockDiscoveryEventsRegistrar.Object, this.protocolConfig); - } - } + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.Linq; + using System.Threading; + using System.Threading.Tasks; + + using Microsoft.VisualStudio.TestPlatform.Client.RequestHelper; + using Microsoft.VisualStudio.TestPlatform.CommandLine; + using Microsoft.VisualStudio.TestPlatform.CommandLine.Processors; + using Microsoft.VisualStudio.TestPlatform.CommandLine.Publisher; + using Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers; + using Microsoft.VisualStudio.TestPlatform.Common.Interfaces; + using Microsoft.VisualStudio.TestPlatform.Common.Logging; + using Microsoft.VisualStudio.TestPlatform.Common.Telemetry; + using Microsoft.VisualStudio.TestPlatform.CoreUtilities.Tracing.Interfaces; + using Microsoft.VisualStudio.TestPlatform.ObjectModel; + using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; + using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.Interfaces; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + using System.Runtime.Versioning; + using Microsoft.VisualStudio.TestPlatform.CommandLineUtilities; + + using Moq; + + using vstest.console.UnitTests.TestDoubles; + using Microsoft.VisualStudio.TestPlatform.Utilities; + using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; + + [TestClass] + public class TestRequestManagerTests + { + private DummyLoggerEvents mockLoggerEvents; + private CommandLineOptions commandLineOptions; + private Mock mockTestPlatform; + private Mock mockOutput; + private Mock mockDiscoveryRequest; + private Mock mockRunRequest; + private Mock mockAssemblyMetadataProvider; + private InferHelper inferHelper; + private ITestRequestManager testRequestManager; + private Mock mockTestPlatformEventSource; + private Mock mockRequestData; + private Mock mockMetricsCollection; + private ProtocolConfig protocolConfig; + private Task mockMetricsPublisherTask; + private Mock mockMetricsPublisher; + private Mock mockProcessHelper; + + private const string DefaultRunsettings = @" + + + + "; + + public TestRequestManagerTests() + { + this.mockLoggerEvents = new DummyLoggerEvents(TestSessionMessageLogger.Instance); + this.commandLineOptions = new DummyCommandLineOptions(); + this.mockOutput = new Mock(); + this.mockTestPlatform = new Mock(); + this.mockDiscoveryRequest = new Mock(); + this.mockRunRequest = new Mock(); + this.mockTestPlatformEventSource = new Mock(); + this.protocolConfig = new ProtocolConfig(); + this.mockAssemblyMetadataProvider = new Mock(); + this.inferHelper = new InferHelper(this.mockAssemblyMetadataProvider.Object); + var testRunResultAggregator = new DummyTestRunResultAggregator(); + this.mockProcessHelper = new Mock(); + + this.mockMetricsPublisher = new Mock(); + this.mockMetricsPublisherTask = Task.FromResult(this.mockMetricsPublisher.Object); + this.testRequestManager = new TestRequestManager( + this.commandLineOptions, + this.mockTestPlatform.Object, + testRunResultAggregator, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + this.mockMetricsCollection = new Mock(); + this.mockRequestData = new Mock(); + this.mockRequestData.Setup(rd => rd.MetricsCollection).Returns(this.mockMetricsCollection.Object); + this.mockTestPlatform.Setup(tp => tp.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) + .Returns(this.mockDiscoveryRequest.Object); + this.mockTestPlatform.Setup(tp => tp.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())) + .Returns(this.mockRunRequest.Object); + this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) + .Returns(Architecture.X86); + this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) + .Returns(new FrameworkName(Constants.DotNetFramework40)); + this.mockProcessHelper.Setup(x => x.GetCurrentProcessId()).Returns(1234); + this.mockProcessHelper.Setup(x => x.GetProcessName(It.IsAny())).Returns("dotnet.exe"); + } + + [TestCleanup] + public void Cleanup() + { + CommandLineOptions.Instance.Reset(); + + // Opt out the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "0"); + } + + [TestMethod] + public void TestRequestManagerShouldNotInitializeConsoleLoggerIfDesignModeIsSet() + { + CommandLineOptions.Instance.IsDesignMode = true; + this.mockLoggerEvents = new DummyLoggerEvents(TestSessionMessageLogger.Instance); + var requestManager = new TestRequestManager(CommandLineOptions.Instance, + new Mock().Object, + TestRunResultAggregator.Instance, + new Mock().Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + Assert.IsFalse(this.mockLoggerEvents.EventsSubscribed()); + } + + [TestMethod] + public void InitializeExtensionsShouldCallTestPlatformToClearAndUpdateExtensions() + { + var paths = new List() { "a", "b" }; + this.testRequestManager.InitializeExtensions(paths, false); + + this.mockTestPlatform.Verify(mt => mt.ClearExtensions(), Times.Once); + this.mockTestPlatform.Verify(mt => mt.UpdateExtensions(paths, false), Times.Once); + } + + [TestMethod] + public void ResetShouldResetCommandLineOptionsInstance() + { + var oldInstance = CommandLineOptions.Instance; + this.testRequestManager.ResetOptions(); + + var newInstance = CommandLineOptions.Instance; + + Assert.AreNotEqual(oldInstance, newInstance, "CommandLineOptions must be cleaned up"); + } + + [TestMethod] + public void DiscoverTestsShouldReadTheBatchSizeFromSettingsAndSetItForDiscoveryCriteria() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a" }, + RunSettings = + @" + + + 15 + + " + }; + + DiscoveryCriteria actualDiscoveryCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => + { + actualDiscoveryCriteria = discoveryCriteria; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager.DiscoverTests(payload, new Mock().Object, this.protocolConfig); + Assert.AreEqual(15, actualDiscoveryCriteria.FrequencyOfDiscoveredTestsEvent); + } + + [TestMethod] + public void DiscoverTestsShouldCallTestPlatformAndSucceed() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = DefaultRunsettings + }; + + var createDiscoveryRequestCalled = 0; + DiscoveryCriteria actualDiscoveryCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => + { + createDiscoveryRequestCalled++; + actualDiscoveryCriteria = discoveryCriteria; + }).Returns(mockDiscoveryRequest.Object); + + var mockDiscoveryRegistrar = new Mock(); + + string testCaseFilterValue = "TestFilter"; + CommandLineOptions.Instance.TestCaseFilterValue = testCaseFilterValue; + this.testRequestManager = new TestRequestManager(CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, this.protocolConfig); + + Assert.AreEqual(testCaseFilterValue, actualDiscoveryCriteria.TestCaseFilter, "TestCaseFilter must be set"); + + Assert.AreEqual(createDiscoveryRequestCalled, 1, "CreateDiscoveryRequest must be invoked only once."); + Assert.AreEqual(2, actualDiscoveryCriteria.Sources.Count(), "All Sources must be used for discovery request"); + Assert.AreEqual("a", actualDiscoveryCriteria.Sources.First(), "First Source in list is incorrect"); + Assert.AreEqual("b", actualDiscoveryCriteria.Sources.ElementAt(1), "Second Source in list is incorrect"); + + // Default frequency is set to 10, unless specified in runsettings. + Assert.AreEqual(10, actualDiscoveryCriteria.FrequencyOfDiscoveredTestsEvent); + + mockDiscoveryRegistrar.Verify(md => md.RegisterDiscoveryEvents(It.IsAny()), Times.Once); + mockDiscoveryRegistrar.Verify(md => md.UnregisterDiscoveryEvents(It.IsAny()), Times.Once); + + mockDiscoveryRequest.Verify(md => md.DiscoverAsync(), Times.Once); + + mockTestPlatformEventSource.Verify(mt => mt.DiscoveryRequestStart(), Times.Once); + mockTestPlatformEventSource.Verify(mt => mt.DiscoveryRequestStop(), Times.Once); + } + + [TestMethod] + public void DiscoverTestsShouldPassSameProtocolConfigInRequestData() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = DefaultRunsettings + }; + + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); + + var mockDiscoveryRegistrar = new Mock(); + + string testCaseFilterValue = "TestFilter"; + CommandLineOptions.Instance.TestCaseFilterValue = testCaseFilterValue; + this.testRequestManager = new TestRequestManager(CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + // Act + this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); + + // Verify. + Assert.AreEqual(4, actualRequestData.ProtocolConfig.Version); + } + + + [TestMethod] + public void DiscoverTestsShouldCollectMetrics() + { + // Opt in the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); + + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a.dll", "b.dll" }, + RunSettings = @" + + 2 + x86 + Framework35 + True + + + 169.254.193.190 + + " + }; + + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + var mockDiscoveryRegistrar = new Mock(); + + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager = new TestRequestManager( + CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + + // Act + this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); + + // Verify. + object targetDevice, maxcount, targetPlatform, disableAppDomain; + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetDevice, out targetDevice)); + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.MaxCPUcount, out maxcount)); + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetPlatform, out targetPlatform)); + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.DisableAppDomain, out disableAppDomain)); + Assert.AreEqual("Other", targetDevice); + Assert.AreEqual(2, maxcount); + Assert.AreEqual("X86", targetPlatform.ToString()); + Assert.AreEqual(true, disableAppDomain); + } + + [TestMethod] + public void DiscoverTestsShouldCollectTargetDeviceLocalMachineIfTargetDeviceStringisEmpty() + { + // Opt in the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); + + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = @" + + + + " + }; + + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + var mockDiscoveryRegistrar = new Mock(); + + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager = new TestRequestManager( + CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + + // Act + this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); + + // Verify. + object targetDevice; + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetDevice, out targetDevice)); + Assert.AreEqual("Local Machine", targetDevice); + } + + [TestMethod] + public void DiscoverTestsShouldCollectTargetDeviceIfTargetDeviceIsDevice() + { + // Opt in the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); + + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = @" + + Device + + " + }; + + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + var mockDiscoveryRegistrar = new Mock(); + + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager = new TestRequestManager( + CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + + // Act + this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); + + // Verify. + object targetDevice; + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetDevice, out targetDevice)); + Assert.AreEqual("Device", targetDevice); + } + + [TestMethod] + public void DiscoverTestsShouldCollectTargetDeviceIfTargetDeviceIsEmulator() + { + // Opt in the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); + + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = @" + + Emulator 8.1 U1 WVGA 4 inch 512MB + + " + }; + + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + var mockDiscoveryRegistrar = new Mock(); + + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager = new TestRequestManager( + CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + + // Act + this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); + + // Verify. + object targetDevice; + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetDevice, out targetDevice)); + Assert.AreEqual("Emulator 8.1 U1 WVGA 4 inch 512MB", targetDevice); + } + + [TestMethod] + public void DiscoverTestsShouldCollectCommands() + { + // Opt in the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); + + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = @" + + Device + + " + }; + + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + var mockDiscoveryRegistrar = new Mock(); + + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager = new TestRequestManager( + CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + CommandLineOptions.Instance.Parallel = true; + CommandLineOptions.Instance.EnableCodeCoverage = true; + CommandLineOptions.Instance.InIsolation = true; + CommandLineOptions.Instance.UseVsixExtensions = true; + CommandLineOptions.Instance.SettingsFile = @"c://temp/.runsettings"; + + // Act + this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); + + // Verify + object commandLineSwitches; + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.CommandLineSwitches, out commandLineSwitches)); + + var commandLineArray = commandLineSwitches.ToString(); + + Assert.IsTrue(commandLineArray.Contains("/Parallel")); + Assert.IsTrue(commandLineArray.Contains("/EnableCodeCoverage")); + Assert.IsTrue(commandLineArray.Contains("/InIsolation")); + Assert.IsTrue(commandLineArray.Contains("/UseVsixExtensions")); + Assert.IsTrue(commandLineArray.Contains("/settings//.RunSettings")); + } + + [TestMethod] + public void DiscoverTestsShouldCollectTestSettings() + { + // Opt in the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); + + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = @" + + Device + + " + }; + + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + var mockDiscoveryRegistrar = new Mock(); + + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager = new TestRequestManager( + CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + CommandLineOptions.Instance.SettingsFile = @"c://temp/.testsettings"; + + // Act + this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); + + // Verify + object commandLineSwitches; + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.CommandLineSwitches, out commandLineSwitches)); + + var commandLineArray = commandLineSwitches.ToString(); + + Assert.IsTrue(commandLineArray.Contains("/settings//.TestSettings")); + } + + [TestMethod] + public void DiscoverTestsShouldCollectVsmdiFile() + { + // Opt in the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); + + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = @" + + Device + + " + }; + + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + var mockDiscoveryRegistrar = new Mock(); + + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager = new TestRequestManager( + CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + CommandLineOptions.Instance.SettingsFile = @"c://temp/.vsmdi"; + + // Act + this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); + + // Verify + object commandLineSwitches; + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.CommandLineSwitches, out commandLineSwitches)); + + var commandLineArray = commandLineSwitches.ToString(); + + Assert.IsTrue(commandLineArray.Contains("/settings//.vsmdi")); + } + + [TestMethod] + public void DiscoverTestsShouldCollectTestRunConfigFile() + { + // Opt in the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); + + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = @" + + Device + + " + }; + + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + var mockDiscoveryRegistrar = new Mock(); + + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => { actualRequestData = requestData; }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager = new TestRequestManager( + CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + CommandLineOptions.Instance.SettingsFile = @"c://temp/.testrunConfig"; + + // Act + this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); + + // Verify + object commandLineSwitches; + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.CommandLineSwitches, out commandLineSwitches)); + + var commandLineArray = commandLineSwitches.ToString(); + + Assert.IsTrue(commandLineArray.Contains("/settings//.testrunConfig")); + } + + [TestMethod] + public void DiscoverTestsShouldUpdateFrameworkAndPlatformIfNotSpecifiedInDesignMode() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + + " + }; + this.commandLineOptions.IsDesignMode = true; + this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) + .Returns(Architecture.ARM); + this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) + .Returns(new FrameworkName(Constants.DotNetFramework46)); + DiscoveryCriteria actualDiscoveryCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => + { + actualDiscoveryCriteria = discoveryCriteria; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager.DiscoverTests(payload, new Mock().Object, this.protocolConfig); + + this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny())); + this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny())); + + Assert.IsTrue(actualDiscoveryCriteria.RunSettings.Contains(Constants.DotNetFramework46)); + Assert.IsTrue(actualDiscoveryCriteria.RunSettings.Contains(Architecture.ARM.ToString())); + } + + [TestMethod] + public void DiscoverTestsShouldNotUpdateFrameworkAndPlatformIfSpecifiedInDesignMode() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a" }, + RunSettings = + $@" + + + {Constants.DotNetFramework46} + {Architecture.ARM.ToString()} + + " + }; + this.commandLineOptions.IsDesignMode = true; + this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) + .Returns(Architecture.X86); + this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) + .Returns(new FrameworkName(Constants.DotNetFramework451)); + DiscoveryCriteria actualDiscoveryCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => + { + actualDiscoveryCriteria = discoveryCriteria; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager.DiscoverTests(payload, new Mock().Object, this.protocolConfig); + + this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny()), Times.Never); + this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny()), Times.Never); + + Assert.IsTrue(actualDiscoveryCriteria.RunSettings.Contains(Constants.DotNetFramework46)); + Assert.IsTrue(actualDiscoveryCriteria.RunSettings.Contains(Architecture.ARM.ToString())); + } + + [TestMethod] + public void DiscoverTestsShouldUpdateFrameworkAndPlatformInCommandLineScenariosIfNotSpecified() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + + " + }; + this.commandLineOptions.IsDesignMode = false; + this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) + .Returns(Architecture.ARM); + this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) + .Returns(new FrameworkName(Constants.DotNetFramework46)); + DiscoveryCriteria actualDiscoveryCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => + { + actualDiscoveryCriteria = discoveryCriteria; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager.DiscoverTests(payload, new Mock().Object, this.protocolConfig); + this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny())); + this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny())); + + Assert.IsTrue(actualDiscoveryCriteria.RunSettings.Contains(Constants.DotNetFramework46)); + Assert.IsTrue(actualDiscoveryCriteria.RunSettings.Contains(Architecture.ARM.ToString())); + } + + [TestMethod] + public void DiscoverTestsShouldNotUpdateFrameworkAndPlatformInCommandLineScenariosIfSpecifiedButInferred() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + + " + }; + this.commandLineOptions.IsDesignMode = false; + this.commandLineOptions.TargetFrameworkVersion = Framework.DefaultFramework; + this.commandLineOptions.TargetArchitecture = Architecture.X86; + this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) + .Returns(Architecture.ARM); + this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) + .Returns(new FrameworkName(Constants.DotNetFramework46)); + DiscoveryCriteria actualDiscoveryCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform + .Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) + .Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => + { + actualDiscoveryCriteria = discoveryCriteria; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager.DiscoverTests(payload, + new Mock().Object, this.protocolConfig); + this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny()), Times.Once); + this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny()), Times.Once); + + Assert.IsFalse(actualDiscoveryCriteria.RunSettings.Contains(Constants.DotNetFramework46)); + Assert.IsFalse(actualDiscoveryCriteria.RunSettings.Contains(Architecture.ARM.ToString())); + } + + [TestMethod] + public void DiscoverTestsShouldPublishMetrics() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a", "b" } + }; + var mockProtocolConfig = new ProtocolConfig { Version = 2 }; + var mockDiscoveryRegistrar = new Mock(); + + // Act + this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); + + // Verify. + this.mockMetricsPublisher.Verify(mp => mp.PublishMetrics(TelemetryDataConstants.TestDiscoveryCompleteEvent, It.IsAny>()), Times.Once); + } + + [TestMethod] + public void CancelShouldNotThrowExceptionIfTestRunRequestHasBeenDisposed() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = DefaultRunsettings + }; + + var mockRunEventsRegistrar = new Mock(); + var mockCustomlauncher = new Mock(); + + this.testRequestManager.RunTests(payload, mockCustomlauncher.Object, mockRunEventsRegistrar.Object, this.protocolConfig); + this.testRequestManager.CancelTestRun(); + } + + [TestMethod] + public void AbortShouldNotThrowExceptionIfTestRunRequestHasBeenDisposed() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = DefaultRunsettings + }; + + var mockRunEventsRegistrar = new Mock(); + var mockCustomlauncher = new Mock(); + + this.testRequestManager.RunTests(payload, mockCustomlauncher.Object, mockRunEventsRegistrar.Object, this.protocolConfig); + this.testRequestManager.AbortTestRun(); + } + + [TestMethod] + public void RunTestsShouldReadTheBatchSizeFromSettingsAndSetItForTestRunCriteria() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a" }, + RunSettings = + @" + + + 15 + + " + }; + + TestRunCriteria actualTestRunCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + Assert.AreEqual(15, actualTestRunCriteria.FrequencyOfRunStatsChangeEvent); + } + + [TestMethod] + public void RunTestsShouldNotThrowForFramework35() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + Framework35 + + " + }; + + TestRunCriteria actualTestRunCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockDiscoveryRequest.Object); + this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())).Returns(new FrameworkName(Constants.DotNetFramework35)); + + var mockRunEventsRegistrar = new Mock(); + var mockCustomlauncher = new Mock(); + + this.testRequestManager.RunTests(payload, mockCustomlauncher.Object, mockRunEventsRegistrar.Object, this.protocolConfig); + + mockRunEventsRegistrar.Verify(lw => lw.LogWarning("Framework35 is not supported. For projects targeting .Net Framework 3.5, test will run in CLR 4.0 \"compatibility mode\"."), Times.Once); + mockTestPlatformEventSource.Verify(mt => mt.ExecutionRequestStart(), Times.Once); + mockTestPlatformEventSource.Verify(mt => mt.ExecutionRequestStop(), Times.Once); + } + + [TestMethod] + public void RunTestsShouldPassSameProtocolConfigInRequestData() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a" }, + RunSettings = DefaultRunsettings + }; + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualRequestData = requestData; + }).Returns(mockDiscoveryRequest.Object); + + // Act. + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, mockProtocolConfig); + + // Verify. + Assert.AreEqual(4, actualRequestData.ProtocolConfig.Version); + } + + [TestMethod] + public void RunTestsShouldCollectCommands() + { + // Opt in the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); + + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a" }, + RunSettings = DefaultRunsettings + }; + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualRequestData = requestData; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager = new TestRequestManager( + CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + CommandLineOptions.Instance.Parallel = true; + CommandLineOptions.Instance.EnableCodeCoverage = true; + CommandLineOptions.Instance.InIsolation = true; + CommandLineOptions.Instance.UseVsixExtensions = true; + CommandLineOptions.Instance.SettingsFile = @"c://temp/.runsettings"; + + // Act. + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, mockProtocolConfig); + + // Verify + object commandLineSwitches; + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.CommandLineSwitches, out commandLineSwitches)); + + var commandLineArray = commandLineSwitches.ToString(); + + Assert.IsTrue(commandLineArray.Contains("/Parallel")); + Assert.IsTrue(commandLineArray.Contains("/EnableCodeCoverage")); + Assert.IsTrue(commandLineArray.Contains("/InIsolation")); + Assert.IsTrue(commandLineArray.Contains("/UseVsixExtensions")); + Assert.IsTrue(commandLineArray.Contains("/settings//.RunSettings")); + } + + [TestMethod] + public void RunTestsShouldCollectTelemetryForLegacySettings() + { + // Opt in the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); + + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a" }, + RunSettings = @" + + + + + + + + + + + + + + + + " + }; + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualRequestData = requestData; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager = new TestRequestManager( + CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + // Act. + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, mockProtocolConfig); + + // Verify + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue("VS.TestRun.LegacySettings.Elements", out var legacySettingsNodes)); + StringAssert.Equals("Deployment, Scripts, Execution, AssemblyResolution, Timeouts, Hosts", legacySettingsNodes); + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue("VS.TestRun.LegacySettings.DeploymentAttributes", out var deploymentAttributes)); + StringAssert.Equals("enabled, deploySatelliteAssemblies", deploymentAttributes); + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue("VS.TestRun.LegacySettings.ExecutionAttributes", out var executionAttributes)); + StringAssert.Equals("hostProcessPlatform, parallelTestCount", executionAttributes); + + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TestSettingsUsed, out var testSettingsUsed)); + Assert.IsFalse((bool)testSettingsUsed); + } + + [TestMethod] + public void RunTestsShouldCollectTelemetryForTestSettingsEmbeddedInsideRunSettings() + { + // Opt in the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); + + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a" }, + RunSettings = @" + + true + ..\..\Foo.testsettings + + " + }; + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualRequestData = requestData; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager = new TestRequestManager( + CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + // Act. + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, mockProtocolConfig); + + // Verify + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TestSettingsUsed, out var testSettingsUsed)); + Assert.IsTrue((bool)testSettingsUsed); + } + + [TestMethod] + public void RunTestsShouldCollectMetrics() + { + // Opt in the Telemetry + Environment.SetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN", "1"); + + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = @" + + 2 + x86 + Framework35 + True + + + 169.254.193.190 + + " + }; + var mockProtocolConfig = new ProtocolConfig { Version = 4 }; + IRequestData actualRequestData = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualRequestData = requestData; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager = new TestRequestManager( + CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + // Act. + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, mockProtocolConfig); + + // Verify + object targetDevice, maxcount, targetPlatform, disableAppDomain; + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetDevice, out targetDevice)); + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.MaxCPUcount, out maxcount)); + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetPlatform, out targetPlatform)); + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.DisableAppDomain, out disableAppDomain)); + Assert.AreEqual("Other", targetDevice); + Assert.AreEqual(2, maxcount); + Assert.AreEqual("X86", targetPlatform.ToString()); + Assert.AreEqual(true, disableAppDomain); + } + + [TestMethod] + public void RunTestsWithSourcesShouldCallTestPlatformAndSucceed() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = DefaultRunsettings + }; + + var createRunRequestCalled = 0; + TestRunCriteria observedCriteria = null; + var mockRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + createRunRequestCalled++; + observedCriteria = runCriteria; + }).Returns(mockRunRequest.Object); + + var mockRunEventsRegistrar = new Mock(); + var mockCustomlauncher = new Mock(); + + string testCaseFilterValue = "TestFilter"; + payload.TestPlatformOptions = new TestPlatformOptions { TestCaseFilter = testCaseFilterValue }; + this.testRequestManager = new TestRequestManager(CommandLineOptions.Instance, + this.mockTestPlatform.Object, + TestRunResultAggregator.Instance, + this.mockTestPlatformEventSource.Object, + this.inferHelper, + this.mockMetricsPublisherTask, + this.mockProcessHelper.Object); + + this.testRequestManager.RunTests(payload, mockCustomlauncher.Object, mockRunEventsRegistrar.Object, this.protocolConfig); + + Assert.AreEqual(testCaseFilterValue, observedCriteria.TestCaseFilter, "TestCaseFilter must be set"); + + Assert.AreEqual(createRunRequestCalled, 1, "CreateRunRequest must be invoked only once."); + Assert.AreEqual(2, observedCriteria.Sources.Count(), "All Sources must be used for discovery request"); + Assert.AreEqual("a", observedCriteria.Sources.First(), "First Source in list is incorrect"); + Assert.AreEqual("b", observedCriteria.Sources.ElementAt(1), "Second Source in list is incorrect"); + + // Check for the default value for the frequency + Assert.AreEqual(10, observedCriteria.FrequencyOfRunStatsChangeEvent); + mockRunEventsRegistrar.Verify(md => md.RegisterTestRunEvents(It.IsAny()), Times.Once); + mockRunEventsRegistrar.Verify(md => md.UnregisterTestRunEvents(It.IsAny()), Times.Once); + + mockRunRequest.Verify(md => md.ExecuteAsync(), Times.Once); + + mockTestPlatformEventSource.Verify(mt => mt.ExecutionRequestStart(), Times.Once); + mockTestPlatformEventSource.Verify(mt => mt.ExecutionRequestStop(), Times.Once); + } + + [TestMethod] + public void RunTestsMultipleCallsShouldNotRunInParallel() + { + var payload1 = new TestRunRequestPayload() + { + Sources = new List() { "a" }, + RunSettings = DefaultRunsettings + }; + + var payload2 = new TestRunRequestPayload() + { + Sources = new List() { "b" }, + RunSettings = DefaultRunsettings + }; + + var mockRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())) + .Returns(mockRunRequest.Object); + + var mockRunEventsRegistrar1 = new Mock(); + var mockRunEventsRegistrar2 = new Mock(); + + // Setup the second one to wait + var sw = new Stopwatch(); + sw.Start(); + + long run1Start = 0; + long run1Stop = 0; + long run2Start = 0; + long run2Stop = 0; + mockRunEventsRegistrar1.Setup(md => md.RegisterTestRunEvents(It.IsAny())).Callback(() => + { + Thread.Sleep(10); + run1Start = sw.ElapsedMilliseconds; + Thread.Sleep(1); + }); + mockRunEventsRegistrar1.Setup(md => md.UnregisterTestRunEvents(It.IsAny())).Callback(() => + { + Thread.Sleep(10); + run1Stop = sw.ElapsedMilliseconds; + Thread.Sleep(10); + }); + + mockRunEventsRegistrar2.Setup(md => md.RegisterTestRunEvents(It.IsAny())).Callback(() => + { + Thread.Sleep(10); + run2Start = sw.ElapsedMilliseconds; + Thread.Sleep(10); + }); + mockRunEventsRegistrar2.Setup(md => md.UnregisterTestRunEvents(It.IsAny())).Callback(() => + { + Thread.Sleep(10); + run2Stop = sw.ElapsedMilliseconds; + }); + + var mockCustomlauncher = new Mock(); + var task1 = Task.Run(() => + { + this.testRequestManager.RunTests(payload1, mockCustomlauncher.Object, mockRunEventsRegistrar1.Object, this.protocolConfig); + }); + var task2 = Task.Run(() => + { + this.testRequestManager.RunTests(payload2, mockCustomlauncher.Object, mockRunEventsRegistrar2.Object, this.protocolConfig); + }); + + Task.WaitAll(task1, task2); + + if (run1Start < run2Start) + { + Assert.IsTrue((run2Stop > run2Start) + && (run2Start > run1Stop) + && (run1Stop > run1Start)); + } + else + { + Assert.IsTrue((run1Stop > run1Start) + && (run1Start > run2Stop) + && (run2Stop > run2Start)); + } + } + + [TestMethod] + public void RunTestsShouldPublishMetrics() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = DefaultRunsettings + }; + + var mockRunEventsRegistrar = new Mock(); + var mockCustomlauncher = new Mock(); + + this.testRequestManager.RunTests(payload, mockCustomlauncher.Object, mockRunEventsRegistrar.Object, this.protocolConfig); + + this.mockMetricsPublisher.Verify(mp => mp.PublishMetrics(TelemetryDataConstants.TestExecutionCompleteEvent, It.IsAny>()), Times.Once); + } + + // TODO: add tests in design mode and executor that they are handling all the exceptions properly including printing inner exception. + + [TestMethod] + public void RunTestsIfThrowsTestPlatformExceptionShouldThrowOut() + { + Assert.ThrowsException(() => RunTestsIfThrowsExceptionShouldThrowOut(new TestPlatformException("HelloWorld"))); + } + + [TestMethod] + public void RunTestsIfThrowsSettingsExceptionShouldThrowOut() + { + Assert.ThrowsException(() => RunTestsIfThrowsExceptionShouldThrowOut(new SettingsException("HelloWorld"))); + } + + [TestMethod] + public void RunTestsIfThrowsInvalidOperationExceptionShouldThrowOut() + { + Assert.ThrowsException(() => RunTestsIfThrowsExceptionShouldThrowOut(new InvalidOperationException("HelloWorld"))); + } + + [TestMethod] + public void RunTestsIfThrowsExceptionShouldThrowOut() + { + Assert.ThrowsException(() => RunTestsIfThrowsExceptionShouldThrowOut(new NotImplementedException("HelloWorld"))); + } + + [TestMethod] + public void DiscoverTestsIfThrowsTestPlatformExceptionShouldThrowOut() + { + Assert.ThrowsException(() => DiscoverTestsIfThrowsExceptionShouldThrowOut(new TestPlatformException("HelloWorld"))); + } + + [TestMethod] + public void DiscoverTestsIfThrowsSettingsExceptionShouldThrowOut() + { + Assert.ThrowsException(() => DiscoverTestsIfThrowsExceptionShouldThrowOut(new SettingsException("HelloWorld"))); + } + + [TestMethod] + public void DiscoverTestsIfThrowsInvalidOperationExceptionShouldThrowOut() + { + Assert.ThrowsException(() => DiscoverTestsIfThrowsExceptionShouldThrowOut(new InvalidOperationException("HelloWorld"))); + } + + [TestMethod] + public void DiscoverTestsIfThrowsExceptionShouldThrowOut() + { + Assert.ThrowsException(() => DiscoverTestsIfThrowsExceptionShouldThrowOut(new NotImplementedException("HelloWorld"))); + } + + [DataTestMethod] + [DataRow(true)] + [DataRow(false)] + public void DiscoverTestsShouldUpdateDesignModeAndCollectSourceInformation(bool designModeValue) + { + var runsettings = ".NETFramework,Version=v4.5"; + var discoveryPayload = CreateDiscoveryPayload(runsettings); + this.commandLineOptions.IsDesignMode = designModeValue; + + this.testRequestManager.DiscoverTests(discoveryPayload, new Mock().Object, this.protocolConfig); + + var designmode = $"{designModeValue}"; + this.mockTestPlatform.Verify( + tp => tp.CreateDiscoveryRequest(It.IsAny(), It.Is(dc => dc.RunSettings.Contains(designmode)), It.IsAny())); + + var collectSourceInformation = $"{designModeValue}"; + this.mockTestPlatform.Verify( + tp => tp.CreateDiscoveryRequest(It.IsAny(), It.Is(dc => dc.RunSettings.Contains(collectSourceInformation)), It.IsAny())); + } + + [TestMethod] + public void DiscoverTestsShouldNotUpdateDesignModeIfUserHasSetDesignModeInRunSettings() + { + var runsettings = "False.NETFramework,Version=v4.5"; + var discoveryPayload = CreateDiscoveryPayload(runsettings); + this.commandLineOptions.IsDesignMode = true; + + this.testRequestManager.DiscoverTests(discoveryPayload, new Mock().Object, this.protocolConfig); + + var designmode = "False"; + this.mockTestPlatform.Verify( + tp => tp.CreateDiscoveryRequest(It.IsAny(), It.Is(dc => dc.RunSettings.Contains(designmode)), It.IsAny())); + } + + [DataTestMethod] + [DataRow(true)] + [DataRow(false)] + public void RunTestsShouldUpdateDesignModeIfRunnerIsInDesignMode(bool designModeValue) + { + var runsettings = + ".NETFramework,Version=v4.5"; + var payload = new TestRunRequestPayload + { + RunSettings = runsettings, + Sources = new List { "c:\\testproject.dll" } + }; + this.commandLineOptions.IsDesignMode = designModeValue; + + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + + var designmode = $"{designModeValue}"; + this.mockTestPlatform.Verify(tp => tp.CreateTestRunRequest(It.IsAny(), It.Is(rc => rc.TestRunSettings.Contains(designmode)), It.IsAny())); + } + + [DataTestMethod] + [DataRow(true)] + [DataRow(false)] + public void DiscoverTestsShouldNotUpdateCollectSourceInformationIfUserHasSetItInRunSettings(bool val) + { + var runsettings = $"{val}"; + var discoveryPayload = CreateDiscoveryPayload(runsettings); + + this.testRequestManager.DiscoverTests(discoveryPayload, new Mock().Object, this.protocolConfig); + + var collectSourceInformation = $"{val}"; + this.mockTestPlatform.Verify( + tp => tp.CreateDiscoveryRequest(It.IsAny(), It.Is(dc => dc.RunSettings.Contains(collectSourceInformation)), It.IsAny())); + } + + [TestMethod] + public void RunTestsShouldShouldUpdateFrameworkAndPlatformIfNotSpecifiedInDesignMode() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + + " + }; + + this.commandLineOptions.IsDesignMode = true; + this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) + .Returns(Architecture.ARM); + this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) + .Returns(new FrameworkName(Constants.DotNetFramework46)); + TestRunCriteria actualTestRunCriteria = null; + var mockTestRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockTestRunRequest.Object); + + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + + this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny())); + this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny())); + + Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Constants.DotNetFramework46)); + Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Architecture.ARM.ToString())); + + } + + [TestMethod] + public void RunTestsShouldNotUpdateFrameworkAndPlatformIfSpecifiedInDesignModeButInferred() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + $@" + + + {Constants.DotNetFramework46} + {Architecture.ARM.ToString()} + + " + }; + + this.commandLineOptions.IsDesignMode = true; + this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) + .Returns(Architecture.X86); + this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) + .Returns(new FrameworkName(Constants.DotNetFramework451)); + TestRunCriteria actualTestRunCriteria = null; + var mockTestRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockTestRunRequest.Object); + + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + + this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny()), Times.Once); + this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny()), Times.Once); + + Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Constants.DotNetFramework46)); + Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Architecture.ARM.ToString())); + } + + [TestMethod] + [DataRow("x86")] + [DataRow("X86")] + [DataRow("ARM")] + [DataRow("aRm")] + public void RunTestsShouldNotUpdatePlatformIfSpecifiedInDesignModeButInferred(string targetPlatform) + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + $@" + + + {targetPlatform} + + " + }; + + this.commandLineOptions.IsDesignMode = true; + this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) + .Returns(Architecture.X86); + this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) + .Returns(new FrameworkName(Constants.DotNetFramework451)); + TestRunCriteria actualTestRunCriteria = null; + var mockTestRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockTestRunRequest.Object); + + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + + this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny()), Times.Once); + this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny()), Times.Once); + + Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(targetPlatform)); + } + + [TestMethod] + public void RunTestsShouldUpdateFrameworkAndPlatformInCommandLineScenarios() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + + " + }; + + this.commandLineOptions.IsDesignMode = false; + this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) + .Returns(Architecture.ARM); + this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) + .Returns(new FrameworkName(Constants.DotNetFramework46)); + TestRunCriteria actualTestRunCriteria = null; + var mockTestRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockTestRunRequest.Object); + + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + + this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny())); + this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny())); + + Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Constants.DotNetFramework46)); + Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Architecture.ARM.ToString())); + } + + [TestMethod] + public void RunTestsShouldNotpdateFrameworkAndPlatformInCommandLineScenariosIfSpecifiedButInferred() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + + " + }; + + this.commandLineOptions.IsDesignMode = false; + this.commandLineOptions.TargetArchitecture = Architecture.X86; + this.commandLineOptions.TargetFrameworkVersion = Framework.DefaultFramework; + this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())) + .Returns(Architecture.ARM); + this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())) + .Returns(new FrameworkName(Constants.DotNetFramework46)); + TestRunCriteria actualTestRunCriteria = null; + var mockTestRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockTestRunRequest.Object); + + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + + this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny()), Times.Once); + this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny()), Times.Once); + + Assert.IsFalse(actualTestRunCriteria.TestRunSettings.Contains(Constants.DotNetFramework46)); + Assert.IsFalse(actualTestRunCriteria.TestRunSettings.Contains(Architecture.ARM.ToString())); + } + + [TestMethod] + public void RunTestsWithTestCasesShouldUpdateFrameworkAndPlatformIfNotSpecifiedInDesignMode() + { + var actualSources = new List() { "1.dll", "2.dll" }; + var payload = new TestRunRequestPayload() + { + TestCases = new List() { + new TestCase(){Source = actualSources[0]}, + new TestCase() { Source = actualSources[0]}, + new TestCase() { Source = actualSources[1] } + }, + RunSettings = + @" + + + + " + }; + + List archSources = new List(), fxSources = new List(); + + this.commandLineOptions.IsDesignMode = true; + this.mockAssemblyMetadataProvider.Setup(a => a.GetArchitecture(It.IsAny())).Callback(source => archSources.Add(source)) + .Returns(Architecture.ARM); + this.mockAssemblyMetadataProvider.Setup(a => a.GetFrameWork(It.IsAny())).Callback(source => fxSources.Add(source)) + .Returns(new FrameworkName(Constants.DotNetFramework46)); + TestRunCriteria actualTestRunCriteria = null; + var mockTestRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockTestRunRequest.Object); + + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + + this.mockAssemblyMetadataProvider.Verify(a => a.GetArchitecture(It.IsAny())); + this.mockAssemblyMetadataProvider.Verify(a => a.GetFrameWork(It.IsAny())); + + Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Constants.DotNetFramework46)); + Assert.IsTrue(actualTestRunCriteria.TestRunSettings.Contains(Architecture.ARM.ToString())); + CollectionAssert.AreEqual(actualSources, archSources); + CollectionAssert.AreEqual(actualSources, fxSources); + } + + [TestMethod] + public void RunTestShouldThrowExceptionIfRunSettingWithDCHasTestSettingsInIt() + { + var settingXml = @" + + C:\temp.testsettings + true + + + + + + + + + + "; + + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = settingXml + }; + + this.commandLineOptions.EnableCodeCoverage = false; + bool exceptionThrown = false; + + try + { + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + } + catch (SettingsException ex) + { + exceptionThrown = true; + Assert.IsTrue(ex.Message.Contains(@"C:\temp.testsettings"), ex.Message); + } + + Assert.IsTrue(exceptionThrown, "Initialize should throw exception"); + } + + [TestMethod] + public void RunTestShouldThrowExceptionIfRunSettingWithDCHasTestSettingsAndEnableCodeCoverageTrue() + { + var settingXml = @" + + C:\temp.testsettings + true + + + + + + + + + + "; + + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = settingXml + }; + + this.commandLineOptions.EnableCodeCoverage = true; + bool exceptionThrown = false; + + try + { + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + } + catch (SettingsException ex) + { + exceptionThrown = true; + Assert.IsTrue(ex.Message.Contains(@"C:\temp.testsettings"), ex.Message); + } + + Assert.IsTrue(exceptionThrown, "Initialize should throw exception"); + } + + [TestMethod] + public void RunTestShouldNotThrowExceptionIfRunSettingHasCodeCoverageDCAndTestSettingsInItWithEnableCoverageTrue() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = @" + + C:\temp.testsettings + true + + + + + + + + " + }; + + this.commandLineOptions.EnableCodeCoverage = true; + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + } + + [TestMethod] + public void RunTestsShouldAddConsoleLoggerInRunSettingsInNonDesignMode() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + + " + }; + + this.commandLineOptions.IsDesignMode = false; + TestRunCriteria actualTestRunCriteria = null; + var mockTestRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockTestRunRequest.Object); + + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + + var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualTestRunCriteria.TestRunSettings).LoggerSettingsList; + Assert.AreEqual(1, loggerSettingsList.Count); + Assert.AreEqual("Console", loggerSettingsList[0].FriendlyName); + Assert.IsNotNull(loggerSettingsList[0].AssemblyQualifiedName); + Assert.IsNotNull(loggerSettingsList[0].CodeBase); + } + + [TestMethod] + public void RunTestsShouldAddConsoleLoggerInRunSettingsIfDesignModeSetFalseInRunSettings() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + False + + + + + + Value1 + + + + + " + }; + + this.commandLineOptions.IsDesignMode = true; + TestRunCriteria actualTestRunCriteria = null; + var mockTestRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockTestRunRequest.Object); + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + + var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualTestRunCriteria.TestRunSettings).LoggerSettingsList; + Assert.AreEqual(2, loggerSettingsList.Count); + Assert.IsNotNull(loggerSettingsList[0].Configuration); + Assert.AreEqual("blabla", loggerSettingsList[0].FriendlyName); + Assert.AreEqual("Console", loggerSettingsList[1].FriendlyName); + Assert.IsNotNull(loggerSettingsList[1].AssemblyQualifiedName); + Assert.IsNotNull(loggerSettingsList[1].CodeBase); + } + + [TestMethod] + public void DiscoverTestsShouldAddConsoleLoggerInRunSettingsIfDesignModeSetFalseInRunSettings() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + False + + + + + + Value1 + + + + + " + }; + this.commandLineOptions.IsDesignMode = true; + DiscoveryCriteria actualDiscoveryCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform + .Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) + .Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => + { + actualDiscoveryCriteria = discoveryCriteria; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager.DiscoverTests(payload, + new Mock().Object, this.protocolConfig); + + var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualDiscoveryCriteria.RunSettings).LoggerSettingsList; + Assert.AreEqual(2, loggerSettingsList.Count); + Assert.IsNotNull(loggerSettingsList[0].Configuration); + Assert.AreEqual("blabla", loggerSettingsList[0].FriendlyName); + Assert.AreEqual("Console", loggerSettingsList[1].FriendlyName); + Assert.IsNotNull(loggerSettingsList[1].AssemblyQualifiedName); + Assert.IsNotNull(loggerSettingsList[1].CodeBase); + } + + [TestMethod] + public void RunTestsShouldNotAddConsoleLoggerInRunSettingsInDesignMode() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + True + + " + }; + + this.commandLineOptions.IsDesignMode = false; + TestRunCriteria actualTestRunCriteria = null; + var mockTestRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockTestRunRequest.Object); + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + + Assert.IsFalse(actualTestRunCriteria.TestRunSettings.Contains("LoggerRunSettings")); + } + + [TestMethod] + public void DiscoverTestsShouldAddConsoleLoggerInRunSettingsInNonDesignMode() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + + " + }; + this.commandLineOptions.IsDesignMode = false; + DiscoveryCriteria actualDiscoveryCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform + .Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) + .Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => + { + actualDiscoveryCriteria = discoveryCriteria; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager.DiscoverTests(payload, + new Mock().Object, this.protocolConfig); + + var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualDiscoveryCriteria.RunSettings).LoggerSettingsList; + Assert.AreEqual(1, loggerSettingsList.Count); + Assert.AreEqual("Console", loggerSettingsList[0].FriendlyName); + Assert.IsNotNull(loggerSettingsList[0].AssemblyQualifiedName); + Assert.IsNotNull(loggerSettingsList[0].CodeBase); + } + + [TestMethod] + public void DiscoverTestsShouldNotAddConsoleLoggerInRunSettingsInDesignMode() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + True + + " + }; + this.commandLineOptions.IsDesignMode = false; + DiscoveryCriteria actualDiscoveryCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform + .Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) + .Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => + { + actualDiscoveryCriteria = discoveryCriteria; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager.DiscoverTests(payload, + new Mock().Object, this.protocolConfig); + + Assert.IsFalse(actualDiscoveryCriteria.RunSettings.Contains("LoggerRunSettings")); + } + + [TestMethod] + public void RunTestsShouldOverrideOnlyAssemblyNameIfConsoleLoggerAlreadyPresentInNonDesignMode() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + False + + + + + + Value1 + + + + + Value1 + + + + + " + }; + + this.commandLineOptions.IsDesignMode = false; + TestRunCriteria actualTestRunCriteria = null; + var mockTestRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockTestRunRequest.Object); + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + + var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualTestRunCriteria.TestRunSettings).LoggerSettingsList; + Assert.AreEqual(2, loggerSettingsList.Count); + Assert.IsNotNull(loggerSettingsList[0].Configuration); + Assert.AreEqual("blabla", loggerSettingsList[0].FriendlyName); + Assert.AreEqual("console", loggerSettingsList[1].FriendlyName); + Assert.AreEqual(new Uri("logger://tempconsoleUri").ToString(), loggerSettingsList[1].Uri.ToString()); + Assert.AreNotEqual("tempAssemblyName", loggerSettingsList[1].AssemblyQualifiedName); + Assert.AreNotEqual("tempCodeBase", loggerSettingsList[1].CodeBase); + Assert.IsTrue(loggerSettingsList[1].Configuration.InnerXml.Contains("Value1")); + Assert.IsNotNull(loggerSettingsList[1].AssemblyQualifiedName); + Assert.IsNotNull(loggerSettingsList[1].CodeBase); + } + + [TestMethod] + public void DiscoverTestsShouldOverrideOnlyAssemblyNameIfConsoleLoggerAlreadyPresentInNonDesignMode() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + False + + + + + + Value1 + + + + + Value1 + + + + + " + }; + this.commandLineOptions.IsDesignMode = false; + DiscoveryCriteria actualDiscoveryCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform + .Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) + .Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => + { + actualDiscoveryCriteria = discoveryCriteria; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager.DiscoverTests(payload, + new Mock().Object, this.protocolConfig); + + var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualDiscoveryCriteria.RunSettings).LoggerSettingsList; + Assert.AreEqual(2, loggerSettingsList.Count); + Assert.IsNotNull(loggerSettingsList[0].Configuration); + Assert.AreEqual("blabla", loggerSettingsList[0].FriendlyName); + Assert.AreEqual("consoleTemp", loggerSettingsList[1].FriendlyName); + Assert.AreEqual(new Uri("logger://Microsoft/TestPlatform/ConsoleLogger/v1").ToString(), loggerSettingsList[1].Uri.ToString()); + Assert.AreNotEqual("tempAssemblyName", loggerSettingsList[1].AssemblyQualifiedName); + Assert.AreNotEqual("tempAssemblyName", loggerSettingsList[1].CodeBase); + Assert.IsTrue(loggerSettingsList[1].Configuration.InnerXml.Contains("Value1")); + Assert.IsNotNull(loggerSettingsList[1].AssemblyQualifiedName); + Assert.IsNotNull(loggerSettingsList[1].CodeBase); + } + + [TestMethod] + public void RunTestsShouldOverrideOnlyAssemblyNameIfConsoleLoggerAlreadyPresentInDesignMode() + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + True + + + + + + Value1 + + + + + Value1 + + + + + " + }; + + this.commandLineOptions.IsDesignMode = false; + TestRunCriteria actualTestRunCriteria = null; + var mockTestRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + actualTestRunCriteria = runCriteria; + }).Returns(mockTestRunRequest.Object); + this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, this.protocolConfig); + + var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualTestRunCriteria.TestRunSettings).LoggerSettingsList; + Assert.AreEqual(2, loggerSettingsList.Count); + Assert.IsNotNull(loggerSettingsList[0].Configuration); + Assert.AreEqual("blabla", loggerSettingsList[0].FriendlyName); + Assert.AreEqual("console", loggerSettingsList[1].FriendlyName); + Assert.AreEqual(new Uri("logger://tempconsoleUri").ToString(), loggerSettingsList[1].Uri.ToString()); + Assert.AreNotEqual("tempAssemblyName", loggerSettingsList[1].AssemblyQualifiedName); + Assert.AreNotEqual("tempCodeBase", loggerSettingsList[1].CodeBase); + Assert.IsTrue(loggerSettingsList[1].Configuration.InnerXml.Contains("Value1")); + Assert.IsNotNull(loggerSettingsList[1].AssemblyQualifiedName); + Assert.IsNotNull(loggerSettingsList[1].CodeBase); + } + + [TestMethod] + public void DiscoverTestsShouldOverrideOnlyAssemblyNameIfConsoleLoggerAlreadyPresentInDesignMode() + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a.dll" }, + RunSettings = + @" + + + True + + + + + + Value1 + + + + + Value1 + + + + + " + }; + this.commandLineOptions.IsDesignMode = false; + DiscoveryCriteria actualDiscoveryCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform + .Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())) + .Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => + { + actualDiscoveryCriteria = discoveryCriteria; + }).Returns(mockDiscoveryRequest.Object); + + this.testRequestManager.DiscoverTests(payload, + new Mock().Object, this.protocolConfig); + + var loggerSettingsList = XmlRunSettingsUtilities.GetLoggerRunSettings(actualDiscoveryCriteria.RunSettings).LoggerSettingsList; + Assert.AreEqual(2, loggerSettingsList.Count); + Assert.IsNotNull(loggerSettingsList[0].Configuration); + Assert.AreEqual("blabla", loggerSettingsList[0].FriendlyName); + Assert.AreEqual("consoleTemp", loggerSettingsList[1].FriendlyName); + Assert.AreEqual(new Uri("logger://Microsoft/TestPlatform/ConsoleLogger/v1").ToString(), loggerSettingsList[1].Uri.ToString()); + Assert.AreNotEqual("tempAssemblyName", loggerSettingsList[1].AssemblyQualifiedName); + Assert.AreNotEqual("tempAssemblyName", loggerSettingsList[1].CodeBase); + Assert.IsTrue(loggerSettingsList[1].Configuration.InnerXml.Contains("Value1")); + Assert.IsNotNull(loggerSettingsList[1].AssemblyQualifiedName); + Assert.IsNotNull(loggerSettingsList[1].CodeBase); + } + + private static DiscoveryRequestPayload CreateDiscoveryPayload(string runsettings) + { + var discoveryPayload = new DiscoveryRequestPayload + { + RunSettings = runsettings, + Sources = new[] { "c:\\testproject.dll" } + }; + return discoveryPayload; + } + + private void RunTestsIfThrowsExceptionShouldThrowOut(Exception exception) + { + var payload = new TestRunRequestPayload() + { + Sources = new List() { "a", "b" }, + RunSettings = DefaultRunsettings + }; + + var createRunRequestCalled = 0; + TestRunCriteria observedCriteria = null; + var mockRunRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateTestRunRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, TestRunCriteria runCriteria, TestPlatformOptions options) => + { + createRunRequestCalled++; + observedCriteria = runCriteria; + }).Returns(mockRunRequest.Object); + + mockRunRequest.Setup(mr => mr.ExecuteAsync()).Throws(exception); + + var mockRunEventsRegistrar = new Mock(); + var mockCustomlauncher = new Mock(); + + this.testRequestManager.RunTests(payload, mockCustomlauncher.Object, mockRunEventsRegistrar.Object, this.protocolConfig); + } + + private void DiscoverTestsIfThrowsExceptionShouldThrowOut(Exception exception) + { + var payload = new DiscoveryRequestPayload() + { + Sources = new List() { "a.dll", "b.dll" }, + RunSettings = DefaultRunsettings + }; + + DiscoveryCriteria observedCriteria = null; + var mockDiscoveryRequest = new Mock(); + this.mockTestPlatform.Setup(mt => mt.CreateDiscoveryRequest(It.IsAny(), It.IsAny(), It.IsAny())).Callback( + (IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options) => + { + observedCriteria = discoveryCriteria; + }).Returns(mockDiscoveryRequest.Object); + + mockDiscoveryRequest.Setup(mr => mr.DiscoverAsync()).Throws(exception); + + var mockDiscoveryEventsRegistrar = new Mock(); + var mockCustomlauncher = new Mock(); + + this.testRequestManager.DiscoverTests(payload, mockDiscoveryEventsRegistrar.Object, this.protocolConfig); + } + } } \ No newline at end of file From 1c593998f58fa5bee9cb34baefd8519f522c41af Mon Sep 17 00:00:00 2001 From: Maximilian Chaplin Date: Mon, 24 Feb 2020 20:58:32 +0100 Subject: [PATCH 3/3] revert some breaking tests --- .../TraceDataCollector.UnitTests/VanguardTests.cs | 2 +- .../Client/ProxyExecutionManagerTests.cs | 2 +- .../Discovery/DiscovererEnumeratorTests.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/DataCollectors/TraceDataCollector.UnitTests/VanguardTests.cs b/test/DataCollectors/TraceDataCollector.UnitTests/VanguardTests.cs index f059d70fc7..a60e00cc4f 100644 --- a/test/DataCollectors/TraceDataCollector.UnitTests/VanguardTests.cs +++ b/test/DataCollectors/TraceDataCollector.UnitTests/VanguardTests.cs @@ -127,7 +127,7 @@ public void StartShouldThrowOnInvalidVarguardPath() public void StartShouldThrowOnInvalidCommandLine() { var expectedErrorMessage = - "Running event not received from CodeCoverage.exe. Check event logs for failure reason."; + "Running event not received from CodeCoverage.exe. Check eventlogs for failure reason."; this.vanguardCommandBuilderMock .Setup(c => c.GenerateCommandLine( VanguardCommand.Collect, diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyExecutionManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyExecutionManagerTests.cs index 43f18f1145..4b25cbf6e4 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyExecutionManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyExecutionManagerTests.cs @@ -426,7 +426,7 @@ public void StartTestRunForCancelRequestShouldHandleLogMessageWithProperErrorMes this.testExecutionManager.StartTestRun(this.mockTestRunCriteria.Object, mockTestRunEventsHandler.Object); - mockTestRunEventsHandler.Verify(s => s.HandleLogMessage(TestMessageLevel.Error, "Canceling the operation as requested.")); + mockTestRunEventsHandler.Verify(s => s.HandleLogMessage(TestMessageLevel.Error, "Cancelling the operation as requested.")); } [TestMethod] diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscovererEnumeratorTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscovererEnumeratorTests.cs index 414b59ba1a..fc6aed366e 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscovererEnumeratorTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Discovery/DiscovererEnumeratorTests.cs @@ -416,7 +416,7 @@ public void LoadTestsShouldNotCallIntoDiscoverersWhenCancelled() // Validate Assert.IsFalse(ManagedDllTestDiscoverer.IsManagedDiscoverTestCalled); Assert.IsFalse(JsonTestDiscoverer.IsDiscoverTestCalled); - this.messageLoggerMock.Verify(logger => logger.SendMessage(TestMessageLevel.Warning, "Discovery of tests canceled."), Times.Once); + this.messageLoggerMock.Verify(logger => logger.SendMessage(TestMessageLevel.Warning, "Discovery of tests cancelled."), Times.Once); } [TestMethod]