Skip to content

Commit

Permalink
Spelling / conventions and grammar fixes (#688)
Browse files Browse the repository at this point in the history
* spelling / conventions and grammar fixes

* Update test/UnitTests/PlatformServices.Shared.Unit.Tests/netstandard1.3/ns13TraceListenerTests.cs

* Update test/UnitTests/PlatformServices.Shared.Unit.Tests/netstandard1.3/ns13TraceListenerManagerTests.cs

Co-authored-by: Jakub Jareš <[email protected]>
  • Loading branch information
HeroMaxPower and nohwnd authored Feb 26, 2020
1 parent cdb43cc commit 088fcd9
Show file tree
Hide file tree
Showing 77 changed files with 202 additions and 202 deletions.
10 changes: 5 additions & 5 deletions src/Adapter/MSTest.CoreAdapter/Discovery/AssemblyEnumerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ internal ICollection<UnitTestElement> EnumerateAssembly(string assemblyFileName,
{
// We only want to load the source assembly in reflection only context in UWP scenarios where it is always an exe.
// For normal test assemblies continue loading it in the default context since:
// 1. There isnt much benefit in terms of Performance loading the assembly in a Reflection Only context during discovery.
// 1. There isn't much benefit in terms of Performance loading the assembly in a Reflection Only context during discovery.
// 2. Loading it in Reflection only context entails a bunch of custom logic to identify custom attributes which is over-kill for normal desktop users.
assembly = PlatformServiceProvider.Instance.FileOperations.LoadAssembly(
assemblyFileName,
Expand Down Expand Up @@ -112,7 +112,7 @@ internal ICollection<UnitTestElement> EnumerateAssembly(string assemblyFileName,
}
catch (Exception exception)
{
// If we fail to discover type from a class, then dont abort the discovery
// If we fail to discover type from a class, then don't abort the discovery
// Move to the next type.
string message = string.Format(
CultureInfo.CurrentCulture,
Expand All @@ -123,7 +123,7 @@ internal ICollection<UnitTestElement> EnumerateAssembly(string assemblyFileName,
warningMessages.Add(message);

PlatformServiceProvider.Instance.AdapterTraceLogger.LogInfo(
"AssemblyEnumerator: Exception occured while enumerating type {0}. {1}",
"AssemblyEnumerator: Exception occurred while enumerating type {0}. {1}",
typeFullName,
exception);
}
Expand Down Expand Up @@ -179,10 +179,10 @@ internal Type[] GetTypes(Assembly assembly, string assemblyFileName, ICollection
}

/// <summary>
/// Formats load exception as multiline string, each line contains load error message.
/// Formats load exception as multi-line string, each line contains load error message.
/// </summary>
/// <param name="ex">The exception.</param>
/// <returns>Returns loader exceptions as a multiline string.</returns>
/// <returns>Returns loader exceptions as a multi-line string.</returns>
internal string GetLoadExceptionDetails(ReflectionTypeLoadException ex)
{
Debug.Assert(ex != null, "exception should not be null.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ internal class AssemblyEnumeratorWrapper
/// <summary>
/// Gets test elements from an assembly.
/// </summary>
/// <param name="assemblyFileName"> The assembly file name. </param>
/// <param name="assemblyFileName"> The assembly file name. </param>
/// <param name="runSettings"> The run Settings. </param>
/// <param name="warnings"> Contains warnings if any, that need to be passed back to the caller. </param>
/// <param name="warnings"> Contains warnings if any, that need to be passed back to the caller. </param>
/// <returns> A collection of test elements. </returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Catching a generic exception since it is a requirement to not abort discovery in case of any errors.")]
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "3#", Justification = "This is only for internal use.")]
Expand Down Expand Up @@ -66,7 +66,7 @@ internal ICollection<UnitTestElement> GetTests(
return null;
}

// Load the assemly in isolation if required.
// Load the assembly in isolation if required.
return this.GetTestsInIsolation(fullFilePath, runSettings, out warnings);
}
catch (FileNotFoundException ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal virtual bool IsValidTestMethod(MethodInfo testMethodInfo, Type type, IC
return false;
}

// Todo: Decide wheter parameter count matters.
// Todo: Decide whether parameter count matters.
// The isGenericMethod check below id to verify that there are no closed generic methods slipping through.
// Closed generic methods being GenericMethod<int> and open being GenericMethod<T>.
var isValidTestMethod = testMethodInfo.IsPublic && !testMethodInfo.IsAbstract && !testMethodInfo.IsStatic
Expand Down
8 changes: 4 additions & 4 deletions src/Adapter/MSTest.CoreAdapter/Execution/StackTraceHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ internal static StackTraceInformation GetStackTraceInformation(Exception ex)
// TODO:Fix the shadow stack-trace used in Private Object
// (Look-in Assertion.cs in the UnitTestFramework assembly)

// Sometimes the stacktrace can be null, but the inner stacktrace
// contains information. We are not interested in null stacktraces
// Sometimes the stack trace can be null, but the inner stack trace
// contains information. We are not interested in null stack traces
// so we simply ignore this case
try
{
Expand All @@ -79,7 +79,7 @@ internal static StackTraceInformation GetStackTraceInformation(Exception ex)
// curException.StackTrace can throw exception, Although MSDN doc doesn't say that.
try
{
// try to get stacktrace
// try to get stack trace
if (e.StackTrace != null)
{
stackTraces.Push(e.StackTrace);
Expand All @@ -88,7 +88,7 @@ internal static StackTraceInformation GetStackTraceInformation(Exception ex)
catch (Exception)
{
PlatformServiceProvider.Instance.AdapterTraceLogger.LogError(
"StackTraceHelper.GetStackTraceInformation: Failed to get stacktrace info.");
"StackTraceHelper.GetStackTraceInformation: Failed to get stack trace info.");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/MSTest.CoreAdapter/Execution/TestAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void RunAssemblyInitialize(TestContext testContext)
// If assembly initialization is not done, then do it.
if (!this.IsAssemblyInitializeExecuted)
{
// Aquiring a lock is usually a costly operation which does not need to be
// Acquiring a lock is usually a costly operation which does not need to be
// performed every time if the assembly init is already executed.
lock (this.assemblyInfoExecuteSyncObject)
{
Expand All @@ -152,7 +152,7 @@ public void RunAssemblyInitialize(TestContext testContext)
}
}

// If assemblyInitialization was successful, then dont do anything
// If assemblyInitialization was successful, then don't do anything
if (this.AssemblyInitializationException == null)
{
return;
Expand Down
6 changes: 3 additions & 3 deletions src/Adapter/MSTest.CoreAdapter/Execution/TestClassInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public void RunClassInitialize(TestContext testContext)
return;
}

// Aquiring a lock is usually a costly operation which does not need to be
// Acquiring a lock is usually a costly operation which does not need to be
// performed every time if the class init is already executed.
lock (this.testClassExecuteSyncObject)
{
Expand Down Expand Up @@ -298,7 +298,7 @@ public void RunClassInitialize(TestContext testContext)
// and class initialization exception is null, then do it.
if (!this.IsClassInitializeExecuted && this.classInitializeMethod != null && this.ClassInitializationException == null)
{
// Aquiring a lock is usually a costly operation which does not need to be
// Acquiring a lock is usually a costly operation which does not need to be
// performed every time if the class init is already executed.
lock (this.testClassExecuteSyncObject)
{
Expand All @@ -322,7 +322,7 @@ public void RunClassInitialize(TestContext testContext)
}
}

// If classInitialization was successful, then dont do anything
// If classInitialization was successful, then don't do anything
if (this.ClassInitializationException == null)
{
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public TestExecutionManager()
/// <param name="tests">Tests to be run.</param>
/// <param name="runContext">Context to use when executing the tests.</param>
/// <param name="frameworkHandle">Handle to the framework to record results and to do framework operations.</param>
/// <param name="runCancellationToken">Test run cancellation tokenn</param>
/// <param name="runCancellationToken">Test run cancellation token</param>
public void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle, TestRunCancellationToken runCancellationToken)
{
Debug.Assert(tests != null, "tests");
Expand Down Expand Up @@ -235,7 +235,7 @@ private void ExecuteTestsInSource(IEnumerable<TestCase> tests, IRunContext runCo

testsToRun = tests.Where(t => MatchTestFilter(filterExpression, t, this.TestMethodFilter));

// this is done so that appropriate values of testcontext properties are set at source level
// this is done so that appropriate values of test context properties are set at source level
// and are merged with session level parameters
var sourceLevelParameters = PlatformServiceProvider.Instance.SettingsProvider.GetProperties(source);

Expand Down
8 changes: 4 additions & 4 deletions src/Adapter/MSTest.CoreAdapter/Execution/TestMethodInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal TestMethodInfo(
public string NotRunnableReason { get; internal set; }

/// <summary>
/// Gets a value indicating whether test is runnnable
/// Gets a value indicating whether test is runnable
/// </summary>
public bool IsRunnable => string.IsNullOrEmpty(this.NotRunnableReason);

Expand Down Expand Up @@ -350,9 +350,9 @@ private TestResult ExecuteInternal(object[] arguments)
// Set the current tests outcome before cleanup so it can be used in the cleanup logic.
this.TestMethodOptions.TestContext.SetOutcome(result.Outcome);

// TestCleanup can potentially be a long running operation which should'nt ideally be in a finally block.
// TestCleanup can potentially be a long running operation which shouldn't ideally be in a finally block.
// Pulling it out so extension writers can abort custom cleanups if need be. Having this in a finally block
// does not allow a threadabort exception to be raised within the block but throws one after finally is executed
// does not allow a thread abort exception to be raised within the block but throws one after finally is executed
// crashing the process. This was blocking writing an extension for Dynamic Timeout in VSO.
if (classInstance != null && testContextSetup)
{
Expand Down Expand Up @@ -788,7 +788,7 @@ void executeAsyncAction()
}
else
{
// Cancel the token source as test has timedout
// Cancel the token source as test has timed out
this.TestMethodOptions.TestContext.Context.CancellationTokenSource.Cancel();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ private UTF.UnitTestOutcome GetAggregateOutcome(List<UTF.TestResult> results)
}

/// <summary>
/// Updates given resutls with parent info if results are greater than 1.
/// Updates given results with parent info if results are greater than 1.
/// Add parent results as first result in updated result.
/// </summary>
/// <param name="results">Results.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class TestRunCancellationToken
/// <summary>
/// Stores whether the test run is canceled or not.
/// </summary>
private bool cancelled;
private bool canceled;

/// <summary>
/// Callback to be invoked when canceled.
Expand All @@ -29,13 +29,13 @@ public bool Canceled
{
get
{
return this.cancelled;
return this.canceled;
}

private set
{
this.cancelled = value;
if (this.cancelled)
this.canceled = value;
if (this.canceled)
{
this.registeredCallback?.Invoke();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/MSTest.CoreAdapter/Execution/TypeCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private TestClassInfo GetClassInfo(TestMethod testMethod)

if (!this.classInfoCache.TryGetValue(typeName, out TestClassInfo classInfo))
{
// Aquiring a lock is usually a costly operation which does not need to be
// Acquiring a lock is usually a costly operation which does not need to be
// performed every time if the type is found in the cache.
lock (this.classInfoSyncObject)
{
Expand Down Expand Up @@ -402,7 +402,7 @@ private TestAssemblyInfo GetAssemblyInfo(Type type)
{
// If we fail to discover type from an assembly, then do not abort. Pick the next type.
PlatformServiceProvider.Instance.AdapterTraceLogger.LogWarning(
"TypeCache: Exception occured while checking whether type {0} is a test class or not. {1}",
"TypeCache: Exception occurred while checking whether type {0} is a test class or not. {1}",
t.FullName,
ex);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ internal static bool TryGetUnitTestAssertException(this Exception exception, out
/// </summary>
/// <param name="testFailureException">An <see cref="TestFailedException"/> instance.</param>
/// <param name="message"> Appends TestFailedException message to this message.</param>
/// <param name="stackTrace"> Appends TestFailedExeption stacktrace to this stackTrace</param>
/// <param name="stackTrace"> Appends TestFailedExeption stack trace to this stackTrace</param>
internal static void TryGetTestFailureExceptionMessageAndStackTrace(this TestFailedException testFailureException, StringBuilder message, StringBuilder stackTrace)
{
if (testFailureException != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ internal static bool HasCorrectTestInitializeOrCleanupSignature(this MethodInfo
/// Verifies that the test method has the correct signature
/// </summary>
/// <param name="method">The method to verify.</param>
/// <param name="ignoreParameterLength">Indicates whether parameter lenght is to be ignored.</param>
/// <param name="ignoreParameterLength">Indicates whether parameter length is to be ignored.</param>
/// <returns>True if the method has the right test method signature.</returns>
internal static bool HasCorrectTestMethodSignature(this MethodInfo method, bool ignoreParameterLength)
{
Expand Down
16 changes: 8 additions & 8 deletions src/Adapter/MSTest.CoreAdapter/Helpers/ReflectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal class ReflectHelper : MarshalByRefObject
/// </summary>
/// <param name="memberInfo">Member/Type to test</param>
/// <param name="attributeType">Attribute to search for</param>
/// <param name="inherit">Look throug inheritence or not</param>
/// <param name="inherit">Look through inheritance or not</param>
/// <returns>True if the attribute of the specified type is defined.</returns>
public virtual bool IsAttributeDefined(MemberInfo memberInfo, Type attributeType, bool inherit)
{
Expand Down Expand Up @@ -68,7 +68,7 @@ public virtual bool IsAttributeDefined(MemberInfo memberInfo, Type attributeType
/// </summary>
/// <param name="type">Member/Type to test</param>
/// <param name="attributeType">Attribute to search for</param>
/// <param name="inherit">Look throug inheritence or not</param>
/// <param name="inherit">Look through inheritance or not</param>
/// <returns>True if the specified attribute is defined on the type.</returns>
public virtual bool IsAttributeDefined(Type type, Type attributeType, bool inherit)
{
Expand Down Expand Up @@ -223,9 +223,9 @@ internal static bool MatchReturnType(MethodInfo method, Type returnType)
/// <summary>
/// Get custom attributes on a member for both normal and reflection only load.
/// </summary>
/// <param name="memberInfo">Memeber for which attributes needs to be retrieved.</param>
/// <param name="memberInfo">Member for which attributes needs to be retrieved.</param>
/// <param name="type">Type of attribute to retrieve.</param>
/// <param name="inherit">If inheritied type of attribute.</param>
/// <param name="inherit">If inherited type of attribute.</param>
/// <returns>All attributes of give type on member.</returns>
internal static Attribute[] GetCustomAttributes(MemberInfo memberInfo, Type type, bool inherit)
{
Expand All @@ -245,8 +245,8 @@ internal static Attribute[] GetCustomAttributes(MemberInfo memberInfo, Type type
/// <summary>
/// Get custom attributes on a member for both normal and reflection only load.
/// </summary>
/// <param name="memberInfo">Memeber for which attributes needs to be retrieved.</param>
/// <param name="inherit">If inheritied type of attribute.</param>
/// <param name="memberInfo">Member for which attributes needs to be retrieved.</param>
/// <param name="inherit">If inherited type of attribute.</param>
/// <returns>All attributes of give type on member.</returns>
internal static object[] GetCustomAttributes(MemberInfo memberInfo, bool inherit)
{
Expand Down Expand Up @@ -301,7 +301,7 @@ internal Attribute GetAttribute(Type attributeType, MethodInfo method)
}

/// <summary>
/// Returns true when the method is delcared in the assembly where the type is declared.
/// Returns true when the method is declared in the assembly where the type is declared.
/// </summary>
/// <param name="method">The method to check for.</param>
/// <param name="type">The type declared in the assembly to check.</param>
Expand Down Expand Up @@ -336,7 +336,7 @@ internal virtual string[] GetCategories(MemberInfo categoryAttributeProvider, Ty
/// <summary>
/// Gets the parallelization level set on an assembly.
/// </summary>
/// <param name="assembly"> The test asembly. </param>
/// <param name="assembly"> The test assembly. </param>
/// <returns> The parallelization level if set. -1 otherwise. </returns>
internal ParallelizeAttribute GetParallelizeAttribute(Assembly assembly)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/MSTest.CoreAdapter/IPlatformServiceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ internal interface IPlatformServiceProvider
/// The run Settings for the session.
/// </param>
/// <param name="frameworkHandle">
/// The handle to the the test platform.
/// The handle to the test platform.
/// </param>
/// <returns>
/// Returns the host for the source provided.
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/MSTest.CoreAdapter/MSTestExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter
public class MSTestExecutor : ITestExecutor
{
/// <summary>
/// Token for cancelling the test run.
/// Token for canceling the test run.
/// </summary>
private TestRunCancellationToken cancellationToken = null;

Expand Down
Loading

0 comments on commit 088fcd9

Please sign in to comment.