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

Add missing nullable #3795

Merged
merged 1 commit into from
Jun 22, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/// <summary>
Expand All @@ -38,18 +35,18 @@ public TestDiscovererPluginInformation(Type testDiscovererType)
/// <summary>
/// Metadata for the test plugin
/// </summary>
public override ICollection<object> Metadata
public override ICollection<object?> Metadata
{
get
{
return new object[] { FileExtensions, DefaultExecutorUri, AssemblyType };
return new object?[] { FileExtensions, DefaultExecutorUri, AssemblyType };
}
}

/// <summary>
/// Gets collection of file extensions supported by discoverer plugin.
/// </summary>
public List<string> FileExtensions
public List<string>? FileExtensions
{
get;
private set;
Expand All @@ -58,7 +55,7 @@ public List<string> FileExtensions
/// <summary>
/// Gets the Uri identifying the executor
/// </summary>
public string DefaultExecutorUri
public string? DefaultExecutorUri
{
get;
private set;
Expand Down Expand Up @@ -126,7 +123,7 @@ private static string GetDefaultExecutorUri(Type testDiscovererType)
/// </summary>
/// <param name="testDiscovererType"> The test discoverer Type. </param>
/// <returns> Supported assembly type. </returns>
private AssemblyType GetAssemblyType(Type testDiscovererType)
private static AssemblyType GetAssemblyType(Type testDiscovererType)
{

// Get Category
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ public void MetadataShouldReturnFileExtensionsAndDefaultExecutorUriAndAssemblyTy
var expectedFileExtensions = new List<string> { "csv", "docx" };
var testPluginMetada = _testPluginInformation.Metadata.ToArray();

CollectionAssert.AreEqual(expectedFileExtensions, ((List<string>)testPluginMetada[0]).ToArray());
CollectionAssert.AreEqual(expectedFileExtensions, ((List<string>)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()!));
}
}

Expand Down