diff --git a/.editorconfig b/.editorconfig
index 748af0581a..2afa770532 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -192,6 +192,10 @@ dotnet_diagnostic.CA1806.severity = warning # not default, increased severity to
# CA1834: Consider using 'StringBuilder.Append(char)' when applicable
dotnet_diagnostic.CA1834.severity = warning # not default, increased severity to ensure it is always applied
+# IDE0190: Null check can be simplified
+# Keep this in sync with the related C# rule: csharp_style_prefer_parameter_null_checking
+dotnet_diagnostic.IDE0190.severity = warning # not default, increased severity to ensure it is applied
+
#### C# Coding Conventions ####
# var preferences
@@ -248,10 +252,14 @@ csharp_style_unused_value_expression_statement_preference = discard_variable:sil
# Keep this in sync with the related .NET rule: IDE0065
csharp_using_directive_placement = inside_namespace:warning
+# IDE0190: Null check can be simplified
+# Keep this in sync with the related .NET rule: IDE0190
+csharp_style_prefer_parameter_null_checking = true # not default, increased severity to ensure it is applied
+
#### .NET Formatting Rules ####
# IDE0055: Fix formatting
-dotnet_diagnostic.IDE0055.severity = warning
+dotnet_diagnostic.IDE0055.severity = suggestion # Downgraded to suggestion due to https://github.com/dotnet/roslyn/issues/59414
#### C# Formatting Rules ####
diff --git a/global.json b/global.json
index 17843464a9..d10f045e24 100644
--- a/global.json
+++ b/global.json
@@ -1,12 +1,12 @@
{
"sdk": {
- "version": "6.0.100",
+ "version": "6.0.300-preview.22110.5",
"rollForward": "minor",
"allowPrerelease": false,
"architecture": "x64"
},
"tools": {
- "dotnet": "6.0.100"
+ "dotnet": "6.0.300-preview.22110.5"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22103.1",
diff --git a/scripts/build.sh b/scripts/build.sh
index 40f6c644b4..d6e2e6bf73 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -199,7 +199,7 @@ function install_cli()
# Skip download of dotnet toolset if REPO API is enabled
local failed=false
local install_script="$TP_TOOLS_DIR/dotnet-install.sh"
- local remote_path="https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh"
+ local remote_path="https://dot.net/v1/dotnet-install.sh"
log "Installing dotnet cli..."
local start=$SECONDS
@@ -212,12 +212,12 @@ function install_cli()
fi
chmod u+x $install_script
# Get netcoreapp1.1 shared components
- $install_script --runtime dotnet --version "2.1.0" --channel "release/2.1.0" --install-dir "$TP_DOTNET_DIR" --no-path --architecture x64
- $install_script --runtime dotnet --version "3.1.0" --channel "release/3.1.0" --install-dir "$TP_DOTNET_DIR" --no-path --architecture x64
- $install_script --runtime dotnet --version "5.0.1" --channel "release/5.0.1" --install-dir "$TP_DOTNET_DIR" --no-path --architecture x64
+ $install_script --runtime dotnet --version "2.1.0" --install-dir "$TP_DOTNET_DIR" --no-path --architecture x64
+ $install_script --runtime dotnet --version "3.1.0" --install-dir "$TP_DOTNET_DIR" --no-path --architecture x64
+ $install_script --runtime dotnet --version "5.0.1" --install-dir "$TP_DOTNET_DIR" --no-path --architecture x64
log "install_cli: Get the latest dotnet cli toolset..."
- $install_script --install-dir "$TP_DOTNET_DIR" --no-path --channel "main" --version $DOTNET_CLI_VERSION
+ $install_script --install-dir "$TP_DOTNET_DIR" --no-path --version $DOTNET_CLI_VERSION
log " ---- dotnet x64"
diff --git a/scripts/common.lib.ps1 b/scripts/common.lib.ps1
index 62bb54ce7d..ab145c9af3 100644
--- a/scripts/common.lib.ps1
+++ b/scripts/common.lib.ps1
@@ -81,7 +81,7 @@ function Install-DotNetCli
{
$timer = Start-Timer
Write-Log "Install-DotNetCli: Get dotnet-install.ps1 script..."
- $dotnetInstallRemoteScript = "https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.ps1"
+ $dotnetInstallRemoteScript = "https://dot.net/v1/dotnet-install.ps1"
$dotnetInstallScript = Join-Path $env:TP_TOOLS_DIR "dotnet-install.ps1"
if (-not (Test-Path $env:TP_TOOLS_DIR)) {
New-Item $env:TP_TOOLS_DIR -Type Directory | Out-Null
diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs b/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs
index c85c40d3af..765093ffe0 100644
--- a/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs
@@ -84,13 +84,8 @@ public static void GetManagedName(MethodBase method, out string managedTypeName,
/// More information about and can be found in
/// the RFC.
///
- public static void GetManagedName(MethodBase method, out string managedTypeName, out string managedMethodName, out string[] hierarchyValues)
+ public static void GetManagedName(MethodBase method!!, out string managedTypeName, out string managedMethodName, out string[] hierarchyValues)
{
- if (method == null)
- {
- throw new ArgumentNullException(nameof(method));
- }
-
if (!ReflectionHelpers.IsMethod(method))
{
throw new NotSupportedException(nameof(method));
diff --git a/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs b/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs
index a5c16318a8..325218b656 100644
--- a/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs
+++ b/src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs
@@ -353,13 +353,8 @@ public void Dispose()
///
/// Invoked when test run is complete
///
- public void HandleTestRunComplete(TestRunCompleteEventArgs runCompleteArgs, TestRunChangedEventArgs lastChunkArgs, ICollection runContextAttachments, ICollection executorUris)
+ public void HandleTestRunComplete(TestRunCompleteEventArgs runCompleteArgs!!, TestRunChangedEventArgs lastChunkArgs, ICollection runContextAttachments, ICollection executorUris)
{
- if (runCompleteArgs == null)
- {
- throw new ArgumentNullException(nameof(runCompleteArgs));
- }
-
bool isAborted = runCompleteArgs.IsAborted;
bool isCanceled = runCompleteArgs.IsCanceled;
diff --git a/src/Microsoft.TestPlatform.Client/TestPlatform.cs b/src/Microsoft.TestPlatform.Client/TestPlatform.cs
index 8efda7dc00..9d3115d4a8 100644
--- a/src/Microsoft.TestPlatform.Client/TestPlatform.cs
+++ b/src/Microsoft.TestPlatform.Client/TestPlatform.cs
@@ -84,13 +84,9 @@ protected TestPlatform(
///
public IDiscoveryRequest CreateDiscoveryRequest(
IRequestData requestData,
- DiscoveryCriteria discoveryCriteria,
+ DiscoveryCriteria discoveryCriteria!!,
TestPlatformOptions options)
{
- if (discoveryCriteria == null)
- {
- throw new ArgumentNullException(nameof(discoveryCriteria));
- }
// Update cache with Extension folder's files.
AddExtensionAssemblies(discoveryCriteria.RunSettings);
@@ -120,14 +116,9 @@ public IDiscoveryRequest CreateDiscoveryRequest(
///
public ITestRunRequest CreateTestRunRequest(
IRequestData requestData,
- TestRunCriteria testRunCriteria,
+ TestRunCriteria testRunCriteria!!,
TestPlatformOptions options)
{
- if (testRunCriteria == null)
- {
- throw new ArgumentNullException(nameof(testRunCriteria));
- }
-
AddExtensionAssemblies(testRunCriteria.TestRunSettings);
var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(testRunCriteria.TestRunSettings);
@@ -162,14 +153,9 @@ public ITestRunRequest CreateTestRunRequest(
///
public bool StartTestSession(
IRequestData requestData,
- StartTestSessionCriteria testSessionCriteria,
+ StartTestSessionCriteria testSessionCriteria!!,
ITestSessionEventsHandler eventsHandler)
{
- if (testSessionCriteria == null)
- {
- throw new ArgumentNullException(nameof(testSessionCriteria));
- }
-
AddExtensionAssemblies(testSessionCriteria.RunSettings);
var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(testSessionCriteria.RunSettings);
diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginManager.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginManager.cs
index ad1563ba21..e6f581485e 100644
--- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginManager.cs
+++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginManager.cs
@@ -57,13 +57,8 @@ public static Type GetTestExtensionType(string extensionTypeName)
/// Return type of the test extension
/// Data type of the extension to be instantiated
/// Test extension instance
- public static T CreateTestExtension(Type extensionType)
+ public static T CreateTestExtension(Type extensionType!!)
{
- if (extensionType == null)
- {
- throw new ArgumentNullException(nameof(extensionType));
- }
-
EqtTrace.Info("TestPluginManager.CreateTestExtension: Attempting to load test extension: " + extensionType);
try
diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/LazyExtension.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/LazyExtension.cs
index 6095d3942e..5a5b1fd02e 100644
--- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/LazyExtension.cs
+++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/LazyExtension.cs
@@ -32,13 +32,8 @@ public class LazyExtension
///
/// Test extension Instance
/// test extension metadata
- public LazyExtension(TExtension instance, TMetadata metadata)
+ public LazyExtension(TExtension instance!!, TMetadata metadata)
{
- if (instance == null)
- {
- throw new ArgumentNullException(nameof(instance));
- }
-
if (metadata == null)
{
throw new ArgumentNullException(nameof(instance));
@@ -54,10 +49,10 @@ public LazyExtension(TExtension instance, TMetadata metadata)
///
/// Test plugin to instantiated on demand.
/// Metadata type to instantiate on demand
- public LazyExtension(TestPluginInformation pluginInfo, Type metadataType)
+ public LazyExtension(TestPluginInformation pluginInfo!!, Type metadataType!!)
{
- TestPluginInfo = pluginInfo ?? throw new ArgumentNullException(nameof(pluginInfo));
- _metadataType = metadataType ?? throw new ArgumentNullException(nameof(metadataType));
+ TestPluginInfo = pluginInfo;
+ _metadataType = metadataType;
IsExtensionCreated = false;
}
@@ -66,14 +61,9 @@ public LazyExtension(TestPluginInformation pluginInfo, Type metadataType)
///
/// Test plugin to instantiated on demand
/// Test extension metadata
- public LazyExtension(TestPluginInformation pluginInfo, TMetadata metadata)
+ public LazyExtension(TestPluginInformation pluginInfo!!, TMetadata metadata!!)
{
- if (metadata == null)
- {
- throw new ArgumentNullException(nameof(metadata));
- }
-
- TestPluginInfo = pluginInfo ?? throw new ArgumentNullException(nameof(pluginInfo));
+ TestPluginInfo = pluginInfo;
_metadata = metadata;
IsExtensionCreated = false;
}
@@ -83,14 +73,9 @@ public LazyExtension(TestPluginInformation pluginInfo, TMetadata metadata)
///
/// Test extension creator delegate
/// test extension metadata
- public LazyExtension(Func creator, TMetadata metadata)
+ public LazyExtension(Func creator!!, TMetadata metadata!!)
{
- if (metadata == null)
- {
- throw new ArgumentNullException(nameof(metadata));
- }
-
- _extensionCreator = creator ?? throw new ArgumentNullException(nameof(creator));
+ _extensionCreator = creator;
_metadata = metadata;
IsExtensionCreated = false;
}
diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/IDataCollectorAttachmentsProcessorsFactory.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/IDataCollectorAttachmentsProcessorsFactory.cs
index 55f35b3bed..c1dd608aab 100644
--- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/IDataCollectorAttachmentsProcessorsFactory.cs
+++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/IDataCollectorAttachmentsProcessorsFactory.cs
@@ -39,9 +39,9 @@ internal class DataCollectorAttachmentProcessor
///
public IDataCollectorAttachmentProcessor DataCollectorAttachmentProcessorInstance { get; private set; }
- public DataCollectorAttachmentProcessor(string friendlyName, IDataCollectorAttachmentProcessor dataCollectorAttachmentProcessor)
+ public DataCollectorAttachmentProcessor(string friendlyName, IDataCollectorAttachmentProcessor dataCollectorAttachmentProcessor!!)
{
FriendlyName = string.IsNullOrEmpty(friendlyName) ? throw new ArgumentException("Invalid FriendlyName", nameof(friendlyName)) : friendlyName;
- DataCollectorAttachmentProcessorInstance = dataCollectorAttachmentProcessor ?? throw new ArgumentNullException(nameof(dataCollectorAttachmentProcessor));
+ DataCollectorAttachmentProcessorInstance = dataCollectorAttachmentProcessor;
}
}
diff --git a/src/Microsoft.TestPlatform.Common/Logging/InternalTestLoggerEvents.cs b/src/Microsoft.TestPlatform.Common/Logging/InternalTestLoggerEvents.cs
index 889a951584..5a494d2ad6 100644
--- a/src/Microsoft.TestPlatform.Common/Logging/InternalTestLoggerEvents.cs
+++ b/src/Microsoft.TestPlatform.Common/Logging/InternalTestLoggerEvents.cs
@@ -176,13 +176,8 @@ internal void EnableEvents()
/// Raises a test run message event to the enabled loggers.
///
/// Arguments to be raised.
- internal void RaiseTestRunMessage(TestRunMessageEventArgs args)
+ internal void RaiseTestRunMessage(TestRunMessageEventArgs args!!)
{
- if (args == null)
- {
- throw new ArgumentNullException(nameof(args));
- }
-
CheckDisposed();
// Sending 0 size as this event is not expected to contain any data.
diff --git a/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs b/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs
index 6704e928ad..518d03888b 100644
--- a/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs
+++ b/src/Microsoft.TestPlatform.Common/Utilities/FakesUtilities.cs
@@ -37,18 +37,8 @@ public static class FakesUtilities
/// test sources
/// runsettings
/// updated runsettings for fakes
- public static string GenerateFakesSettingsForRunConfiguration(string[] sources, string runSettingsXml)
+ public static string GenerateFakesSettingsForRunConfiguration(string[] sources!!, string runSettingsXml!!)
{
- if (sources == null)
- {
- throw new ArgumentNullException(nameof(sources));
- }
-
- if (runSettingsXml == null)
- {
- throw new ArgumentNullException(nameof(runSettingsXml));
- }
-
var doc = new XmlDocument();
using (var xmlReader = XmlReader.Create(
new StringReader(runSettingsXml),
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Output/OutputExtensions.cs b/src/Microsoft.TestPlatform.CoreUtilities/Output/OutputExtensions.cs
index 55bcac0cb7..5bcbc51cab 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Output/OutputExtensions.cs
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Output/OutputExtensions.cs
@@ -88,13 +88,8 @@ public static void Write(this IOutput output, string message, OutputLevel level,
/// Format string for the message type.
/// Format string for the error message.
/// Arguments to format into the format string.
- private static void Output(IOutput output, OutputLevel level, string messageTypeFormat, string format, params object[] args)
+ private static void Output(IOutput output!!, OutputLevel level, string messageTypeFormat, string format, params object[] args)
{
- if (output == null)
- {
- throw new ArgumentNullException(nameof(output));
- }
-
output.WriteLine(Format(messageTypeFormat, format, args), level);
}
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Utilities/JobQueue.cs b/src/Microsoft.TestPlatform.CoreUtilities/Utilities/JobQueue.cs
index 8bf7dd4459..ace90a0e10 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Utilities/JobQueue.cs
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Utilities/JobQueue.cs
@@ -101,9 +101,9 @@ public class JobQueue : IDisposable
/// The max Queue Size.
/// The enable Bounds.
/// The exception Logger.
- public JobQueue(Action processJob, string displayName, int maxQueueLength, int maxQueueSize, bool enableBounds, Action exceptionLogger)
+ public JobQueue(Action processJob!!, string displayName, int maxQueueLength, int maxQueueSize, bool enableBounds, Action exceptionLogger)
{
- _processJob = processJob ?? throw new ArgumentNullException(nameof(processJob));
+ _processJob = processJob;
if (string.IsNullOrWhiteSpace(displayName))
{
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Utilities/MulticastDelegateUtilities.cs b/src/Microsoft.TestPlatform.CoreUtilities/Utilities/MulticastDelegateUtilities.cs
index 58ac06ddc8..43063fa145 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Utilities/MulticastDelegateUtilities.cs
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Utilities/MulticastDelegateUtilities.cs
@@ -39,13 +39,8 @@ public static void SafeInvoke(this Delegate delegates, object sender, EventArgs
/// Sender to use when raising the event.
/// Arguments to provide.
/// Name to use when tracing out errors.
- public static void SafeInvoke(this Delegate delegates, object sender, object args, string traceDisplayName)
+ public static void SafeInvoke(this Delegate delegates, object sender, object args!!, string traceDisplayName)
{
- if (args == null)
- {
- throw new ArgumentNullException(nameof(args));
- }
-
if (string.IsNullOrWhiteSpace(traceDisplayName))
{
throw new ArgumentNullException(nameof(traceDisplayName));
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/AttachmentsProcessing/TestRunAttachmentsProcessingManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/AttachmentsProcessing/TestRunAttachmentsProcessingManager.cs
index 18548977ab..72bf6a3294 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/AttachmentsProcessing/TestRunAttachmentsProcessingManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/AttachmentsProcessing/TestRunAttachmentsProcessingManager.cs
@@ -37,10 +37,10 @@ internal class TestRunAttachmentsProcessingManager : ITestRunAttachmentsProcessi
///
/// Initializes a new instance of the class.
///
- public TestRunAttachmentsProcessingManager(ITestPlatformEventSource testPlatformEventSource, IDataCollectorAttachmentsProcessorsFactory dataCollectorAttachmentsProcessorsFactory)
+ public TestRunAttachmentsProcessingManager(ITestPlatformEventSource testPlatformEventSource!!, IDataCollectorAttachmentsProcessorsFactory dataCollectorAttachmentsProcessorsFactory!!)
{
- _testPlatformEventSource = testPlatformEventSource ?? throw new ArgumentNullException(nameof(testPlatformEventSource));
- _dataCollectorAttachmentsProcessorsFactory = dataCollectorAttachmentsProcessorsFactory ?? throw new ArgumentNullException(nameof(dataCollectorAttachmentsProcessorsFactory));
+ _testPlatformEventSource = testPlatformEventSource;
+ _dataCollectorAttachmentsProcessorsFactory = dataCollectorAttachmentsProcessorsFactory;
}
///
@@ -209,9 +209,9 @@ private class AttachmentsProcessingMessageLogger : IMessageLogger
{
private readonly ITestRunAttachmentsProcessingEventsHandler _eventsHandler;
- public AttachmentsProcessingMessageLogger(ITestRunAttachmentsProcessingEventsHandler eventsHandler)
+ public AttachmentsProcessingMessageLogger(ITestRunAttachmentsProcessingEventsHandler eventsHandler!!)
{
- _eventsHandler = eventsHandler ?? throw new ArgumentNullException(nameof(eventsHandler));
+ _eventsHandler = eventsHandler;
}
public void SendMessage(TestMessageLevel testMessageLevel, string message)
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelRunDataAggregator.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelRunDataAggregator.cs
index 71261c64ff..9709f2a9da 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelRunDataAggregator.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelRunDataAggregator.cs
@@ -33,9 +33,9 @@ internal class ParallelRunDataAggregator
#endregion
- public ParallelRunDataAggregator(string runSettingsXml)
+ public ParallelRunDataAggregator(string runSettingsXml!!)
{
- RunSettings = runSettingsXml ?? throw new ArgumentNullException(nameof(runSettingsXml));
+ RunSettings = runSettingsXml;
ElapsedTime = TimeSpan.Zero;
RunContextAttachments = new Collection();
RunCompleteArgsAttachments = new List();
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/TestHostManagerFactory.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/TestHostManagerFactory.cs
index d49bf6ae41..17075119a0 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/TestHostManagerFactory.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/TestHostManagerFactory.cs
@@ -28,9 +28,9 @@ public class TestHostManagerFactory : ITestHostManagerFactory
///
/// Provide common services and data for a discovery/run request.
///
- public TestHostManagerFactory(IRequestData requestData)
+ public TestHostManagerFactory(IRequestData requestData!!)
{
- _requestData = requestData ?? throw new System.ArgumentNullException(nameof(requestData));
+ _requestData = requestData;
}
///
diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameLogger.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameLogger.cs
index ea85a37815..2703b9282f 100644
--- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameLogger.cs
+++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameLogger.cs
@@ -76,13 +76,8 @@ protected BlameLogger(IOutput output, IBlameReaderWriter blameReaderWriter)
///
/// Events that can be registered for.
/// Test Run Directory
- public void Initialize(TestLoggerEvents events, string testRunDictionary)
+ public void Initialize(TestLoggerEvents events!!, string testRunDictionary)
{
- if (events == null)
- {
- throw new ArgumentNullException(nameof(events));
- }
-
events.TestRunComplete += TestRunCompleteHandler;
}
@@ -91,13 +86,8 @@ public void Initialize(TestLoggerEvents events, string testRunDictionary)
///
/// Sender
/// TestRunCompleteEventArgs
- private void TestRunCompleteHandler(object sender, TestRunCompleteEventArgs e)
+ private void TestRunCompleteHandler(object sender!!, TestRunCompleteEventArgs e)
{
- if (sender == null)
- {
- throw new ArgumentNullException(nameof(sender));
- }
-
ValidateArg.NotNull