diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestDiscovererPluginInformation.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestDiscovererPluginInformation.cs index 3f1c5f9ced..216fbc0ed8 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestDiscovererPluginInformation.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestDiscovererPluginInformation.cs @@ -8,11 +8,8 @@ using System.Reflection; using Microsoft.VisualStudio.TestPlatform.Common.Utilities; - using Microsoft.VisualStudio.TestPlatform.ObjectModel; -#nullable disable - namespace Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.Utilities; /// @@ -38,18 +35,18 @@ public TestDiscovererPluginInformation(Type testDiscovererType) /// /// Metadata for the test plugin /// - public override ICollection Metadata + public override ICollection Metadata { get { - return new object[] { FileExtensions, DefaultExecutorUri, AssemblyType }; + return new object?[] { FileExtensions, DefaultExecutorUri, AssemblyType }; } } /// /// Gets collection of file extensions supported by discoverer plugin. /// - public List FileExtensions + public List? FileExtensions { get; private set; @@ -58,7 +55,7 @@ public List FileExtensions /// /// Gets the Uri identifying the executor /// - public string DefaultExecutorUri + public string? DefaultExecutorUri { get; private set; @@ -126,7 +123,7 @@ private static string GetDefaultExecutorUri(Type testDiscovererType) /// /// The test discoverer Type. /// Supported assembly type. - private AssemblyType GetAssemblyType(Type testDiscovererType) + private static AssemblyType GetAssemblyType(Type testDiscovererType) { // Get Category diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestDiscovererPluginInformationTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestDiscovererPluginInformationTests.cs index ef8fea965b..2233c13ba6 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestDiscovererPluginInformationTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/ExtensionFramework/Utilities/TestDiscovererPluginInformationTests.cs @@ -126,9 +126,9 @@ public void MetadataShouldReturnFileExtensionsAndDefaultExecutorUriAndAssemblyTy var expectedFileExtensions = new List { "csv", "docx" }; var testPluginMetada = _testPluginInformation.Metadata.ToArray(); - CollectionAssert.AreEqual(expectedFileExtensions, ((List)testPluginMetada[0]).ToArray()); + CollectionAssert.AreEqual(expectedFileExtensions, ((List)testPluginMetada[0]!).ToArray()); Assert.AreEqual("csvexecutor", testPluginMetada[1] as string); - Assert.AreEqual(AssemblyType.Managed, Enum.Parse(typeof(AssemblyType), testPluginMetada[2].ToString()!)); + Assert.AreEqual(AssemblyType.Managed, Enum.Parse(typeof(AssemblyType), testPluginMetada[2]!.ToString()!)); } }