Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix some missing xml docs #4841

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@
<LangVersion>preview</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!--
Make sure any documentation comments which are included in code get checked for syntax during the build, but do
not report warnings for missing comments.

CS1573: Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do)
CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
-->
<NoWarn>$(NoWarn),1573,1591</NoWarn>
</PropertyGroup>

<!-- The TFMs to build and test against. -->
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/MSTest.TestAdapter/Execution/TestClassInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class TestClassInfo
/// </summary>
/// <param name="type">Underlying test class type.</param>
/// <param name="constructor">Constructor for the test class.</param>
/// <param name="isParameterlessConstructor">Whether or not the test class constructor has no parameters.</param>
/// <param name="classAttribute">Test class attribute.</param>
/// <param name="parent">Parent assembly info.</param>
internal TestClassInfo(
Expand Down
4 changes: 4 additions & 0 deletions src/Adapter/MSTest.TestAdapter/Execution/TestMethodInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ private void ThrowMultipleAttributesException(string attributeName)
/// Execute test without timeout.
/// </summary>
/// <param name="arguments">Arguments to be passed to the method.</param>
/// <param name="timeoutTokenSource">The timeout token source.</param>
/// <returns>The result of the execution.</returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Requirement is to handle all kinds of user exceptions and message appropriately.")]
private TestResult ExecuteInternal(object?[]? arguments, CancellationTokenSource? timeoutTokenSource)
Expand Down Expand Up @@ -490,6 +491,7 @@ private static Exception GetRealException(Exception ex)
/// be expected or not expected.
/// </summary>
/// <param name="ex">Exception that was thrown.</param>
/// <param name="realException">Real exception thrown by the test method.</param>
/// <param name="className">The class name.</param>
/// <param name="methodName">The method name.</param>
/// <returns>Test framework exception with details.</returns>
Expand Down Expand Up @@ -561,6 +563,7 @@ private static TestFailedException HandleMethodException(Exception ex, Exception
/// Runs TestCleanup methods of parent TestClass and base classes.
/// </summary>
/// <param name="result">Instance of TestResult.</param>
/// <param name="timeoutTokenSource">The timeout token source.</param>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Requirement is to handle all kinds of user exceptions and message appropriately.")]
private void RunTestCleanupMethod(TestResult result, CancellationTokenSource? timeoutTokenSource)
{
Expand Down Expand Up @@ -696,6 +699,7 @@ private void RunTestCleanupMethod(TestResult result, CancellationTokenSource? ti
/// </summary>
/// <param name="classInstance">Instance of TestClass.</param>
/// <param name="result">Instance of TestResult.</param>
/// <param name="timeoutTokenSource">The timeout token source.</param>
/// <returns>True if the TestInitialize method(s) did not throw an exception.</returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Requirement is to handle all kinds of user exceptions and message appropriately.")]
private bool RunTestInitializeMethod(object classInstance, TestResult result, CancellationTokenSource? timeoutTokenSource)
Expand Down
5 changes: 5 additions & 0 deletions src/Adapter/MSTest.TestAdapter/Execution/UnitTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ internal sealed class UnitTestRunner : MarshalByRefObject
/// Initializes a new instance of the <see cref="UnitTestRunner"/> class.
/// </summary>
/// <param name="settings"> Specifies adapter settings that need to be instantiated in the domain running these tests. </param>
/// <param name="testsToRun"> The tests to run. </param>
/// <param name="classCleanupLifecycle"> The class cleanup lifecycle. </param>
public UnitTestRunner(MSTestSettings settings, UnitTestElement[] testsToRun, int? classCleanupLifecycle)
: this(settings, testsToRun, classCleanupLifecycle, ReflectHelper.Instance)
{
Expand All @@ -40,6 +42,8 @@ public UnitTestRunner(MSTestSettings settings, UnitTestElement[] testsToRun, int
/// Initializes a new instance of the <see cref="UnitTestRunner"/> class.
/// </summary>
/// <param name="settings"> Specifies adapter settings. </param>
/// <param name="testsToRun"> The tests to run. </param>
/// <param name="classCleanupLifecycle"> The class cleanup lifecycle. </param>
/// <param name="reflectHelper"> The reflect Helper. </param>
internal UnitTestRunner(MSTestSettings settings, UnitTestElement[] testsToRun, int? classCleanupLifecycle, ReflectHelper reflectHelper)
{
Expand Down Expand Up @@ -134,6 +138,7 @@ internal TestResult[] RunSingleTest(TestMethod testMethod, IDictionary<string, o
/// </summary>
/// <param name="testMethod"> The test Method. </param>
/// <param name="testContextProperties"> The test context properties. </param>
/// <param name="messageLogger"> The message logger. </param>
/// <returns> The <see cref="TestResult"/>. </returns>
internal async Task<TestResult[]> RunSingleTestAsync(TestMethod testMethod, IDictionary<string, object?> testContextProperties, IMessageLogger messageLogger)
{
Expand Down
5 changes: 5 additions & 0 deletions src/Adapter/MSTest.TestAdapter/IPlatformServiceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ internal interface IPlatformServiceProvider
/// </summary>
TestRunCancellationToken? TestRunCancellationToken { get; set; }

/// <summary>
/// Gets or sets a value indicating whether a graceful stop is requested.
/// </summary>
bool IsGracefulStopRequested { get; set; }

/// <summary>
Expand Down Expand Up @@ -120,6 +123,8 @@ ITestSourceHost CreateTestSourceHost(
/// <param name="properties">
/// The default set of properties the test context needs to be filled with.
/// </param>
/// <param name="messageLogger">The message logger.</param>
/// <param name="outcome">The test outcome.</param>
/// <returns>
/// The <see cref="ITestContext"/> instance.
/// </returns>
Expand Down
6 changes: 3 additions & 3 deletions src/Adapter/MSTest.TestAdapter/MSTestSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,9 @@ private static bool IsRunSettingsFileHasSettingName(string? runSettingsXml, stri
/// <summary>
/// Populate adapter settings from the context.
/// </summary>
/// <param name="context">
/// <param name="context">The discovery context.</param>
/// <param name="logger"> The logger for messages. </param>
/// The discovery context that contains the runsettings.
/// </param>
/// <param name="configuration">The configuration.</param>
internal static void PopulateSettings(IDiscoveryContext? context, IMessageLogger? logger, IConfiguration? configuration)
{
#if !WINDOWS_UWP
Expand Down Expand Up @@ -916,6 +915,7 @@ private static void ParseIntegerSetting(IConfiguration configuration, string key
/// </summary>
/// <param name="configuration">Configuration to load the settings from.</param>
/// <param name="logger"> The logger for messages. </param>
/// <param name="settings">The MSTest settings.</param>
internal static void SetSettingsFromConfig(IConfiguration configuration, IMessageLogger? logger, MSTestSettings settings)
{
// Expected format of the json is: -
Expand Down
2 changes: 2 additions & 0 deletions src/Adapter/MSTest.TestAdapter/PlatformServiceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ public ITestSourceHost CreateTestSourceHost(
/// <param name="properties">
/// The default set of properties the test context needs to be filled with.
/// </param>
/// <param name="messageLogger">The message logger.</param>
/// <param name="outcome">The test outcome.</param>
/// <returns>
/// The <see cref="ITestContext"/> instance.
/// </returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@

namespace Microsoft.VisualStudio.TestTools.UnitTesting;

/// <summary>
/// Extension methods for <see cref="ITestApplicationBuilder"/>.
/// </summary>
[SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")]
public static class TestApplicationBuilderExtensions
{
/// <summary>
/// Register MSTest as the test framework and register the necessary services.
/// </summary>
/// <param name="testApplicationBuilder">The test application builder on which to register.</param>
/// <param name="getTestAssemblies">The function to get the test assemblies.</param>
public static void AddMSTest(this ITestApplicationBuilder testApplicationBuilder, Func<IEnumerable<Assembly>> getTestAssemblies)
{
MSTestExtension extension = new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public IReadOnlyCollection<string> GetFullPathToDependentAssemblies(string assem
/// Get the target dotNet framework string for the assembly.
/// </summary>
/// <param name="path">Path of the assembly file.</param>
/// <param name="errorMessage">Error message if any.</param>
/// <returns> String representation of the target dotNet framework e.g. .NETFramework,Version=v4.0. </returns>
internal string GetTargetFrameworkVersionStringFromPath(string path, out string? errorMessage)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ internal static class CompilationExtensions
/// </summary>
/// <param name="compilation">The compilation.</param>
/// <param name="fullTypeName">Namespace + type name, e.g. "System.Exception".</param>
/// <returns>The <see cref="INamedTypeSymbol"/> if found, null otherwise.</returns>
/// <param name="namedTypeSymbol">The <see cref="INamedTypeSymbol"/> if found, null otherwise.</param>
/// <returns>A boolean indicating whether or not the service was found.</returns>
internal static bool TryGetOrCreateTypeByMetadataName(this Compilation compilation, string fullTypeName, [NotNullWhen(returnValue: true)] out INamedTypeSymbol? namedTypeSymbol)
=> WellKnownTypeProvider.GetOrCreate(compilation).TryGetOrCreateTypeByMetadataName(fullTypeName, out namedTypeSymbol);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@

namespace Microsoft.Testing.Platform.Helpers;

/// <summary>
/// A collection of extension methods for <see cref="ITestApplicationBuilder"/>.
/// </summary>
[Experimental("TPEXP", UrlFormat = "https://aka.ms/testingplatform/diagnostics#{0}")]
[SuppressMessage("ApiDesign", "RS0016:Add public types and members to the declared API", Justification = "Experimental API")]
public static class TestApplicationBuilderExtensions
{
/// <summary>
/// Registers the command-line options provider for '--treenode-filter'.
/// </summary>
/// <param name="testApplicationBuilder">The test application builder.</param>
/// <param name="extension">The extension owner of the tree node filter service.</param>
public static void AddTreeNodeFilterService(this ITestApplicationBuilder testApplicationBuilder, IExtension extension)
=> testApplicationBuilder.CommandLine.AddProvider(() => new TreeNodeFilterCommandLineOptionsProvider(extension));

/// <summary>
/// Registers the command-line options provider for '--maximum-failed-tests'.
/// </summary>
/// <param name="builder">The test application builder.</param>
/// <param name="extension">The extension owner of the maximum failed tests service.</param>
[Experimental("TPEXP", UrlFormat = "https://aka.ms/testingplatform/diagnostics#{0}")]
public static void AddMaximumFailedTestsService(this ITestApplicationBuilder builder, IExtension extension)
=> builder.CommandLine.AddProvider(serviceProvider => new MaxFailedTestsCommandLineOptionsProvider(extension, serviceProvider));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1486,6 +1486,7 @@ internal static bool IsSubsetOfHelper(ICollection subset, ICollection superset)
/// <param name="collection">
/// The collection to process.
/// </param>
/// <param name="comparer">The equality comparer to use when comparing items.</param>
/// <param name="nullCount">
/// The number of null elements in the collection.
/// </param>
Expand Down Expand Up @@ -1531,6 +1532,7 @@ private static Dictionary<T, int> GetElementCounts<T>(IEnumerable<T?> collection
/// <param name="actual">
/// The second collection to compare.
/// </param>
/// <param name="comparer">The equality comparer to use when comparing items.</param>
/// <param name="expectedCount">
/// The expected number of occurrences of
/// <paramref name="mismatchedElement"/> or 0 if there is no mismatched
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public sealed class OSConditionAttribute : ConditionBaseAttribute
/// <summary>
/// Initializes a new instance of the <see cref="OSConditionAttribute"/> class.
/// </summary>
/// <param name="mode">Decides whether the OSes will be included or excluded.</param>
/// <param name="operatingSystems">The operating systems that this test supports.</param>
public OSConditionAttribute(ConditionMode mode, OperatingSystems operatingSystems)
: base(mode)
Expand Down
3 changes: 3 additions & 0 deletions test/Utilities/Automation.CLI/CLITestBase.e2e.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public CLITestBase()
/// </summary>
/// <param name="sources">Collection of test containers.</param>
/// <param name="runSettings">Run settings for execution.</param>
/// <param name="targetFramework">Target framework for the test run.</param>
public void InvokeVsTestForDiscovery(string[] sources, string runSettings = "", string targetFramework = null)
{
ExpandTestSourcePaths(sources, targetFramework);
Expand All @@ -44,6 +45,7 @@ public void InvokeVsTestForDiscovery(string[] sources, string runSettings = "",
/// <param name="sources">List of test assemblies.</param>
/// <param name="runSettings">Run settings for execution.</param>
/// <param name="testCaseFilter">Test Case filter for execution.</param>
/// <param name="targetFramework">Target framework for the test run.</param>
public void InvokeVsTestForExecution(string[] sources, string runSettings = "", string testCaseFilter = null, string targetFramework = null)
{
ExpandTestSourcePaths(sources, targetFramework);
Expand Down Expand Up @@ -297,6 +299,7 @@ private static string GetTestMethodName(string testFullName)
/// Converts relative paths to absolute.
/// </summary>
/// <param name="paths">An array of file paths, elements may be modified to absolute paths.</param>
/// <param name="targetFramework">Target framework for the test run.</param>
private void ExpandTestSourcePaths(string[] paths, string targetFramework = null)
{
for (int i = 0; i < paths.Length; i++)
Expand Down
Loading