diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentItemUtility.cs b/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentItemUtility.cs index 867f593dae..07479ffe20 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentItemUtility.cs +++ b/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentItemUtility.cs @@ -79,7 +79,7 @@ internal IList GetClassLevelDeploymentItems(Type type, ICollecti /// The warning message if it is an invalid deployment item. /// Returns true if it is a valid deployment item. [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "2#", Justification = "Internal method.")] - internal static bool IsValidDeploymentItem([NotNullWhen(true)] string? sourcePath, [NotNullWhen(true)] string? relativeOutputDirectory, out string warning) + internal static bool IsValidDeploymentItem([NotNullWhen(true)] string? sourcePath, [NotNullWhen(true)] string? relativeOutputDirectory, [NotNullWhen(false)] out string? warning) { if (StringEx.IsNullOrEmpty(sourcePath)) { @@ -105,7 +105,7 @@ internal static bool IsValidDeploymentItem([NotNullWhen(true)] string? sourcePat return false; } - warning = string.Empty; + warning = null; return true; } diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns13DeploymentItemUtilityTests.cs b/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns13DeploymentItemUtilityTests.cs index 5f64b0a4ef..dea08157df 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns13DeploymentItemUtilityTests.cs +++ b/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns13DeploymentItemUtilityTests.cs @@ -389,7 +389,7 @@ public void IsValidDeploymentItemShouldReturnTrueForAValidDeploymentItem() { Verify(DeploymentItemUtility.IsValidDeploymentItem(_defaultDeploymentItemPath, _defaultDeploymentItemOutputDirectory, out string warning)); - Verify(string.Empty.Equals(warning, StringComparison.Ordinal)); + Verify(warning is null); } #endregion