Skip to content

Commit

Permalink
Run dotnet format whitespace (#1085)
Browse files Browse the repository at this point in the history
* Run dotnet format whitespace

Co-authored-by: Medeni Baykal <433724+Haplois@users.noreply.github.com>
  • Loading branch information
Evangelink and Haplois committed Apr 26, 2022
1 parent 9437f21 commit bf1f427
Show file tree
Hide file tree
Showing 27 changed files with 167 additions and 167 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public override List<string> GetColumns(string tableName)
}
catch (Exception exception)
{
EqtTrace.ErrorIf(EqtTrace.IsErrorEnabled, exception.Message + " for CSV data source " + this.fileName);
EqtTrace.ErrorIf(EqtTrace.IsErrorEnabled, exception.Message + " for CSV data source " + this.fileName);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,65 +283,65 @@ internal virtual List<string> GetResolutionPaths(string sourceFileName, bool isP
return resolutionPaths;
}

internal virtual string GetTargetFrameworkVersionString(string sourceFileName)
{
return AppDomainUtilities.GetTargetFrameworkVersionString(sourceFileName);
}

private string GetConfigFileForTestSource(string sourceFileName)
{
return new DeploymentUtility().GetConfigFile(sourceFileName);
}

/// <summary>
/// Sets context required for running tests.
/// </summary>
/// <param name="source">
/// source parameter used for setting context
/// </param>
private void SetContext(string source)
{
if (string.IsNullOrEmpty(source))
internal virtual string GetTargetFrameworkVersionString(string sourceFileName)
{
return;
return AppDomainUtilities.GetTargetFrameworkVersionString(sourceFileName);
}

Exception setWorkingDirectoryException = null;
this.currentDirectory = Environment.CurrentDirectory;

try
{
Environment.CurrentDirectory = Path.GetDirectoryName(source);
EqtTrace.Info("MSTestExecutor: Changed the working directory to {0}", Environment.CurrentDirectory);
}
catch (IOException ex)
{
setWorkingDirectoryException = ex;
}
catch (System.Security.SecurityException ex)
private string GetConfigFileForTestSource(string sourceFileName)
{
setWorkingDirectoryException = ex;
return new DeploymentUtility().GetConfigFile(sourceFileName);
}

if (setWorkingDirectoryException != null)
/// <summary>
/// Sets context required for running tests.
/// </summary>
/// <param name="source">
/// source parameter used for setting context
/// </param>
private void SetContext(string source)
{
EqtTrace.Error("MSTestExecutor.SetWorkingDirectory: Failed to set the working directory to '{0}'. {1}", Path.GetDirectoryName(source), setWorkingDirectoryException);
if (string.IsNullOrEmpty(source))
{
return;
}

Exception setWorkingDirectoryException = null;
this.currentDirectory = Environment.CurrentDirectory;

try
{
Environment.CurrentDirectory = Path.GetDirectoryName(source);
EqtTrace.Info("MSTestExecutor: Changed the working directory to {0}", Environment.CurrentDirectory);
}
catch (IOException ex)
{
setWorkingDirectoryException = ex;
}
catch (System.Security.SecurityException ex)
{
setWorkingDirectoryException = ex;
}

if (setWorkingDirectoryException != null)
{
EqtTrace.Error("MSTestExecutor.SetWorkingDirectory: Failed to set the working directory to '{0}'. {1}", Path.GetDirectoryName(source), setWorkingDirectoryException);
}
}
}

/// <summary>
/// Resets the context as it was before calling SetContext()
/// </summary>
private void ResetContext()
{
if (!string.IsNullOrEmpty(this.currentDirectory))
/// <summary>
/// Resets the context as it was before calling SetContext()
/// </summary>
private void ResetContext()
{
Environment.CurrentDirectory = this.currentDirectory;
if (!string.IsNullOrEmpty(this.currentDirectory))
{
Environment.CurrentDirectory = this.currentDirectory;
}
}
}

private void AddSearchDirectoriesSpecifiedInRunSettingsToAssemblyResolver(AssemblyResolver assemblyResolver, string baseDirectory)
{
private void AddSearchDirectoriesSpecifiedInRunSettingsToAssemblyResolver(AssemblyResolver assemblyResolver, string baseDirectory)
{
// Check if user specified any adapter settings
MSTestAdapterSettings adapterSettings = MSTestSettingsProvider.Settings;

Expand All @@ -364,7 +364,7 @@ private void AddSearchDirectoriesSpecifiedInRunSettingsToAssemblyResolver(Assemb
}
}
}
}
}

#pragma warning restore SA1649 // SA1649FileNameMustMatchTypeName
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public override List<string> GetColumns(string tableName)
}
catch (Exception exception)
{
EqtTrace.ErrorIf(EqtTrace.IsErrorEnabled, exception.Message + " for CSV data source " + this.fileName);
EqtTrace.ErrorIf(EqtTrace.IsErrorEnabled, exception.Message + " for CSV data source " + this.fileName);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,65 +283,65 @@ internal virtual List<string> GetResolutionPaths(string sourceFileName, bool isP
return resolutionPaths;
}

internal virtual string GetTargetFrameworkVersionString(string sourceFileName)
{
return AppDomainUtilities.GetTargetFrameworkVersionString(sourceFileName);
}

private string GetConfigFileForTestSource(string sourceFileName)
{
return new DeploymentUtility().GetConfigFile(sourceFileName);
}

/// <summary>
/// Sets context required for running tests.
/// </summary>
/// <param name="source">
/// source parameter used for setting context
/// </param>
private void SetContext(string source)
{
if (string.IsNullOrEmpty(source))
internal virtual string GetTargetFrameworkVersionString(string sourceFileName)
{
return;
return AppDomainUtilities.GetTargetFrameworkVersionString(sourceFileName);
}

Exception setWorkingDirectoryException = null;
this.currentDirectory = Environment.CurrentDirectory;

try
{
Environment.CurrentDirectory = Path.GetDirectoryName(source);
EqtTrace.Info("MSTestExecutor: Changed the working directory to {0}", Environment.CurrentDirectory);
}
catch (IOException ex)
{
setWorkingDirectoryException = ex;
}
catch (System.Security.SecurityException ex)
private string GetConfigFileForTestSource(string sourceFileName)
{
setWorkingDirectoryException = ex;
return new DeploymentUtility().GetConfigFile(sourceFileName);
}

if (setWorkingDirectoryException != null)
/// <summary>
/// Sets context required for running tests.
/// </summary>
/// <param name="source">
/// source parameter used for setting context
/// </param>
private void SetContext(string source)
{
EqtTrace.Error("MSTestExecutor.SetWorkingDirectory: Failed to set the working directory to '{0}'. {1}", Path.GetDirectoryName(source), setWorkingDirectoryException);
if (string.IsNullOrEmpty(source))
{
return;
}

Exception setWorkingDirectoryException = null;
this.currentDirectory = Environment.CurrentDirectory;

try
{
Environment.CurrentDirectory = Path.GetDirectoryName(source);
EqtTrace.Info("MSTestExecutor: Changed the working directory to {0}", Environment.CurrentDirectory);
}
catch (IOException ex)
{
setWorkingDirectoryException = ex;
}
catch (System.Security.SecurityException ex)
{
setWorkingDirectoryException = ex;
}

if (setWorkingDirectoryException != null)
{
EqtTrace.Error("MSTestExecutor.SetWorkingDirectory: Failed to set the working directory to '{0}'. {1}", Path.GetDirectoryName(source), setWorkingDirectoryException);
}
}
}

/// <summary>
/// Resets the context as it was before calling SetContext()
/// </summary>
private void ResetContext()
{
if (!string.IsNullOrEmpty(this.currentDirectory))
/// <summary>
/// Resets the context as it was before calling SetContext()
/// </summary>
private void ResetContext()
{
Environment.CurrentDirectory = this.currentDirectory;
if (!string.IsNullOrEmpty(this.currentDirectory))
{
Environment.CurrentDirectory = this.currentDirectory;
}
}
}

private void AddSearchDirectoriesSpecifiedInRunSettingsToAssemblyResolver(AssemblyResolver assemblyResolver, string baseDirectory)
{
private void AddSearchDirectoriesSpecifiedInRunSettingsToAssemblyResolver(AssemblyResolver assemblyResolver, string baseDirectory)
{
// Check if user specified any adapter settings
MSTestAdapterSettings adapterSettings = MSTestSettingsProvider.Settings;

Expand All @@ -364,7 +364,7 @@ private void AddSearchDirectoriesSpecifiedInRunSettingsToAssemblyResolver(Assemb
}
}
}
}
}

#pragma warning restore SA1649 // SA1649FileNameMustMatchTypeName
}
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public string GetDiagnosticMessages()
/// </summary>
public void ClearDiagnosticMessages()
{
this.threadSafeStringWriter.ToStringAndClear();
this.threadSafeStringWriter.ToStringAndClear();
}

public void SetDataRow(object dataRow)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public Assembly LoadAssembly(string assemblyName, bool isReflectionOnly)
/// <returns>Path to the .DLL of the assembly.</returns>
public string GetAssemblyPath(Assembly assembly)
{
#if NETSTANDARD1_5
return assembly.Location;
#else
#if NETSTANDARD1_5
return assembly.Location;
#else
return null;
#endif
#endif
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Uti
{
using System;

#pragma warning disable SA1649 // File name must match first type name
#pragma warning disable SA1649 // File name must match first type name

internal class Validate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected override void Dispose(bool disposing)
ThreadSafeStringWriter.State?.Value?.Remove(this.outputType);
try
{
base.Dispose(disposing);
base.Dispose(disposing);
}
catch (ObjectDisposedException)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting
/// <summary>
/// The Data source element collection.
/// </summary>
[SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface", Justification ="Compat")]
[SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface", Justification = "Compat")]
public sealed class DataSourceElementCollection : ConfigurationElementCollection
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace PlatformServices.Desktop.ComponentTests
[TestClass]
[Serializable]
public class TestProjectForAssemblyResolution : MarshalByRefObject
{
{
[TestMethod]
public void TestMethod1()
{
Expand Down
4 changes: 2 additions & 2 deletions test/E2ETests/DiscoveryAndExecutionTests/OutputTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private static void ValidateOutputIsNotMixed(ReadOnlyCollection<OM.TestResult> t
var testMethod = testResults.Single(t => t.DisplayName == methodName);
Assert.IsNotNull(testMethod, $"Test method {methodName} was not found.");
var message = testMethod.Messages.SingleOrDefault(messageFilter);
Assert.IsNotNull(message, $"Message for {testMethod.DisplayName} was not found. All messages: { string.Join(Environment.NewLine, testMethod.Messages.Select(m=> $"{m.Category} - {m.Text}")) }");
Assert.IsNotNull(message, $"Message for {testMethod.DisplayName} was not found. All messages: { string.Join(Environment.NewLine, testMethod.Messages.Select(m => $"{m.Category} - {m.Text}")) }");
StringAssert.Matches(message.Text, new Regex(methodName), testMethod.DisplayName);
StringAssert.Matches(message.Text, new Regex("TestInitialize"), testMethod.DisplayName);
StringAssert.Matches(message.Text, new Regex("TestCleanup"), testMethod.DisplayName);
Expand All @@ -93,7 +93,7 @@ private static void ValidateOutputIsNotMixed(ReadOnlyCollection<OM.TestResult> t
private static void ValidateInitializeAndCleanup(ReadOnlyCollection<OM.TestResult> testResults, Func<TestResultMessage, bool> messageFilter)
{
// It is not deterministic where the class initialize and class cleanup will run, so we look at all tests, to make sure it is includes somewhere.
var output = string.Join(Environment.NewLine, testResults.SelectMany(r=>r.Messages).Where(messageFilter).Select(m=>m.Text));
var output = string.Join(Environment.NewLine, testResults.SelectMany(r => r.Messages).Where(messageFilter).Select(m => m.Text));
Assert.IsNotNull(output);
StringAssert.Matches(output, new Regex("ClassInitialize"));
StringAssert.Matches(output, new Regex("ClassCleanup"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void ExecuteCustomTestExtensibilityWithTestDataTests()
}

[TestMethod]
public void BailOutWhenDuplicateTestDisplayName()
public void BailOutWhenDuplicateTestDisplayName()
{
// Arrange
var assemblyPath = Path.IsPathRooted(TestAssembly) ? TestAssembly : this.GetAssetFullPath(TestAssembly);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ internal void DynamicDataTestMethod(SerializableInternalType serializableInterna

}

public static IEnumerable<object[]> DynamicData => new []
public static IEnumerable<object[]> DynamicData => new[]
{
new object[] { new SerializableInternalType() }
};
Expand Down
2 changes: 1 addition & 1 deletion test/E2ETests/TestAssets/OutputTestProject/Assembly.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

[assembly: Parallelize(Scope = ExecutionScope.MethodLevel, Workers = 0)]
[assembly: ClassCleanupExecution(ClassCleanupBehavior.EndOfClass)]
[assembly: ClassCleanupExecution(ClassCleanupBehavior.EndOfClass)]
2 changes: 1 addition & 1 deletion test/E2ETests/TestAssets/ParallelTestClass/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace ParallelClassesTestProject
{
using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
public class UnitTest1
{
Expand Down
2 changes: 1 addition & 1 deletion test/E2ETests/TestAssets/ParallelTestClass/UnitTest3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace ParallelClassesTestProject
{
using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
public class UnitTest3
{
Expand Down
2 changes: 1 addition & 1 deletion test/E2ETests/TestAssets/ParallelTestMethods/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace ParallelMethodsTestProject
{
using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
public class UnitTest1
{
Expand Down
Loading

0 comments on commit bf1f427

Please sign in to comment.