Skip to content

Commit

Permalink
fix nulability of test hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Dec 8, 2024
1 parent 45e6516 commit 49df182
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,15 @@ static UnitTestElement GetAssemblyFixtureTest(MethodInfo methodInfo, string asse
string assemblyLocation, string fixtureType)
{
string methodName = GetMethodName(methodInfo);
string[] hierarchy = [null!, assemblyName, Constants.AssemblyFixturesHierarchyClassName, methodName];
string?[] hierarchy = [null, assemblyName, Constants.AssemblyFixturesHierarchyClassName, methodName];
return GetFixtureTest(classFullName, assemblyLocation, fixtureType, methodName, hierarchy);
}

static UnitTestElement GetClassFixtureTest(MethodInfo methodInfo, string assemblyName, string className, string classFullName,
string assemblyLocation, string fixtureType)
{
string methodName = GetMethodName(methodInfo);
string[] hierarchy = [null!, classFullName, methodName];
string?[] hierarchy = [null, classFullName, methodName];
return GetFixtureTest(classFullName, assemblyLocation, fixtureType, methodName, hierarchy);
}

Expand All @@ -376,7 +376,7 @@ static string GetMethodName(MethodInfo methodInfo)
: methodInfo.Name;
}

static UnitTestElement GetFixtureTest(string classFullName, string assemblyLocation, string fixtureType, string methodName, string[] hierarchy)
static UnitTestElement GetFixtureTest(string classFullName, string assemblyLocation, string fixtureType, string methodName, string?[] hierarchy)
{
var method = new TestMethod(classFullName, methodName, hierarchy, methodName, classFullName, assemblyLocation, false, null, TestIdGenerationStrategy.FullyQualified);
return new UnitTestElement(method)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ internal static UnitTestElement ToUnitTestElement(this TestCase testCase, string
(int)TestIdGenerationStrategy.FullyQualified);

TestMethod testMethod = testCase.ContainsManagedMethodAndType()
? new(testCase.GetManagedType(), testCase.GetManagedMethod(), testCase.GetHierarchy()!, name, testClassName!, source, isAsync, testCase.DisplayName, testIdGenerationStrategy)
? new(testCase.GetManagedType(), testCase.GetManagedMethod(), testCase.GetHierarchy(), name, testClassName!, source, isAsync, testCase.DisplayName, testIdGenerationStrategy)
: new(name, testClassName!, source, isAsync, testCase.DisplayName, testIdGenerationStrategy);
var dataType = (DynamicDataType)testCase.GetPropertyValue(Constants.TestDynamicDataTypeProperty, (int)DynamicDataType.None);
if (dataType != DynamicDataType.None)
Expand Down

0 comments on commit 49df182

Please sign in to comment.