Skip to content

Commit

Permalink
Set SkipArcadeNoWarnCS1591 to true (#4937)
Browse files Browse the repository at this point in the history
Co-authored-by: Amaury Levé <[email protected]>
  • Loading branch information
Youssef1313 and Evangelink authored Feb 10, 2025
1 parent 244a038 commit c773614
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,10 @@ public interface ITestContext
/// <param name="displayName">The display name.</param>
void SetDisplayName(string? displayName);

/// <summary>
/// Displays a message in the output.
/// </summary>
/// <param name="messageLevel">The level of the message.</param>
/// <param name="message">The message to display.</param>
void DisplayMessage(MessageLevel messageLevel, string message);
}
7 changes: 5 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<Project>

<Import Project="../Directory.Build.props" />

<PropertyGroup>
<Nullable>enable</Nullable>
<!-- This needs to happen before importing Arcade props (which is imported via the parent Directory.Build.props) -->
<!-- Otherwise, Arcade would have already included 1591 in NoWarn -->
<SkipArcadeNoWarnCS1591>true</SkipArcadeNoWarnCS1591>
</PropertyGroup>

<Import Project="../Directory.Build.props" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ namespace Microsoft.Testing.Platform.Capabilities.TestFramework;
[Experimental("TPEXP", UrlFormat = "https://aka.ms/testingplatform/diagnostics#{0}")]
public interface IGracefulStopTestExecutionCapability : ITestFrameworkCapability
{
/// <summary>
/// Stops the test execution gracefully.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
Task StopTestExecutionAsync(CancellationToken cancellationToken);
}
20 changes: 20 additions & 0 deletions src/Platform/Microsoft.Testing.Platform/Messages/TestNodeUid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,35 @@ public sealed class TestNodeUid(string value) : IEquatable<TestNodeUid>
/// </summary>
public string Value { get; init; } = Guard.NotNullOrWhiteSpace(value);

/// <summary>
/// Implicitly converts a <see cref="TestNodeUid"/> to a <see cref="string"/>.
/// </summary>
/// <param name="testNode">The <see cref="TestNodeUid"/> value to convert.</param>
public static implicit operator string(TestNodeUid testNode)
=> testNode.Value;

/// <summary>
/// Implicitly converts a string to a <see cref="TestNodeUid"/>.
/// </summary>
/// <param name="value">The <see cref="TestNodeUid"/> value as <see cref="string"/>.</param>
public static implicit operator TestNodeUid(string value)
=> new(value);

/// <summary>
/// Checks whether two <see cref="TestNodeUid"/> instances are equal.
/// </summary>
/// <param name="left">The first <see cref="TestNodeUid"/>.</param>
/// <param name="right">The second <see cref="TestNodeUid"/>.</param>
/// <returns><c>true</c> if the two instances are equal; <c>false</c> otherwise.</returns>
public static bool operator ==(TestNodeUid left, TestNodeUid right)
=> left.Equals(right);

/// <summary>
/// Checks whether two <see cref="TestNodeUid"/> instances are not equal.
/// </summary>
/// <param name="left">The first <see cref="TestNodeUid"/>.</param>
/// <param name="right">The second <see cref="TestNodeUid"/>.</param>
/// <returns><c>true</c> if the two instances are not equal; <c>false</c> otherwise.</returns>
public static bool operator !=(TestNodeUid left, TestNodeUid right)
=> !left.Equals(right);

Expand Down
2 changes: 2 additions & 0 deletions src/TestFramework/TestFramework/Assertions/Assert.AreEqual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public sealed partial class Assert
[InterpolatedStringHandler]
[EditorBrowsable(EditorBrowsableState.Never)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "This is not meant to be consumed by users.")]
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public readonly struct AssertAreEqualInterpolatedStringHandler<TArgument>
{
private readonly StringBuilder? _builder;
Expand Down Expand Up @@ -365,6 +366,7 @@ internal void ComputeAssertion()
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters
#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

/// <summary>
/// Tests whether the specified values are equal and throws an exception
Expand Down
2 changes: 2 additions & 0 deletions src/TestFramework/TestFramework/Assertions/Assert.AreSame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public sealed partial class Assert
[InterpolatedStringHandler]
[EditorBrowsable(EditorBrowsableState.Never)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "This is not meant to be consumed by users.")]
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public readonly struct AssertAreSameInterpolatedStringHandler<TArgument>
{
private readonly StringBuilder? _builder;
Expand Down Expand Up @@ -131,6 +132,7 @@ internal void ComputeAssertion()
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters
#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

/// <summary>
/// Tests whether the specified objects both refer to the same object and
Expand Down
2 changes: 2 additions & 0 deletions src/TestFramework/TestFramework/Assertions/Assert.Contains.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public sealed partial class Assert
[InterpolatedStringHandler]
[EditorBrowsable(EditorBrowsableState.Never)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "This is not meant to be consumed by users.")]
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public readonly struct AssertSingleInterpolatedStringHandler<TItem>
{
private readonly StringBuilder? _builder;
Expand Down Expand Up @@ -88,6 +89,7 @@ public void AppendFormatted(object? value, int alignment = 0, string? format = n
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters
#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

/// <summary>
/// Tests whether the specified collection contains exactly one element.
Expand Down
2 changes: 2 additions & 0 deletions src/TestFramework/TestFramework/Assertions/Assert.Count.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public sealed partial class Assert
[InterpolatedStringHandler]
[EditorBrowsable(EditorBrowsableState.Never)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "This is not meant to be consumed by users.")]
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public readonly struct AssertCountInterpolatedStringHandler<TItem>
{
private readonly StringBuilder? _builder;
Expand Down Expand Up @@ -162,6 +163,7 @@ public void AppendFormatted(object? value, int alignment = 0, string? format = n
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters
#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

/// <summary>
/// Tests that the collection is not empty.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public sealed partial class Assert
[InterpolatedStringHandler]
[EditorBrowsable(EditorBrowsableState.Never)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "This is not meant to be consumed by users.")]
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public readonly struct AssertIsInstanceOfTypeInterpolatedStringHandler
{
private readonly StringBuilder? _builder;
Expand Down Expand Up @@ -255,6 +256,7 @@ internal void ComputeAssertion()
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters
#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

/// <summary>
/// Tests whether the specified object is an instance of the expected
Expand Down
4 changes: 4 additions & 0 deletions src/TestFramework/TestFramework/Assertions/Assert.IsNull.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public sealed partial class Assert
[InterpolatedStringHandler]
[EditorBrowsable(EditorBrowsableState.Never)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "This is not meant to be consumed by users.")]
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public readonly struct AssertIsNullInterpolatedStringHandler
{
private readonly StringBuilder? _builder;
Expand Down Expand Up @@ -69,10 +70,12 @@ internal void ComputeAssertion()
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters
#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

[InterpolatedStringHandler]
[EditorBrowsable(EditorBrowsableState.Never)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "This is not meant to be consumed by users.")]
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public readonly struct AssertIsNotNullInterpolatedStringHandler
{
private readonly StringBuilder? _builder;
Expand Down Expand Up @@ -127,6 +130,7 @@ internal void ComputeAssertion()
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters
#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

/// <summary>
/// Tests whether the specified object is null and throws an exception
Expand Down
2 changes: 2 additions & 0 deletions src/TestFramework/TestFramework/Assertions/Assert.IsTrue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public sealed partial class Assert
[InterpolatedStringHandler]
[EditorBrowsable(EditorBrowsableState.Never)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "This is not meant to be consumed by users.")]
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public readonly struct AssertIsTrueInterpolatedStringHandler
{
private readonly StringBuilder? _builder;
Expand Down Expand Up @@ -127,6 +128,7 @@ internal void ComputeAssertion()
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters
#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

/// <summary>
/// Tests whether the specified condition is true and throws an exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public sealed partial class Assert
[InterpolatedStringHandler]
[EditorBrowsable(EditorBrowsableState.Never)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "This is not meant to be consumed by users.")]
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public readonly struct AssertNonStrictThrowsInterpolatedStringHandler<TException>
where TException : Exception
{
Expand Down Expand Up @@ -147,6 +148,7 @@ internal TException ComputeAssertion()
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters
#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

/// <summary>
/// Asserts that the delegate <paramref name="action"/> throws an exception of type <typeparamref name="TException"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting;
/// </summary>
public interface ITestDataSourceUnfoldingCapability
{
/// <summary>
/// Gets the strategy for unfolding parameterized tests.
/// </summary>
TestDataSourceUnfoldingStrategy UnfoldingStrategy { get; }
}

Expand Down

0 comments on commit c773614

Please sign in to comment.