Skip to content

Commit

Permalink
Add missing nullable (#3795)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink authored Jun 22, 2022
1 parent 12ed796 commit 69a84d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
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

0 comments on commit 69a84d7

Please sign in to comment.