Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Sep 4, 2024
2 parents 58ab3ef + 2b1e7bc commit 41d3ddb
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Verify.NUnit/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ public static IMethodInfo GetTestMethod(this TestAdapter adapter)

public static bool TryGetParent(this TestAdapter adapter, [NotNullWhen(true)] out ITest? parent)
{
var test = adapter.GetTest();
parent = test.Parent;
parent = adapter.Parent;
if (parent is ParameterizedMethodSuite methodSuite)
{
parent = methodSuite.Parent;
Expand All @@ -23,12 +22,6 @@ public static bool TryGetParent(this TestAdapter adapter, [NotNullWhen(true)] ou
return parent != null;
}

static FieldInfo testField = typeof(TestAdapter)
.GetField("_test", BindingFlags.Instance | BindingFlags.NonPublic)!;

public static Test GetTest(this TestAdapter adapter) =>
(Test) testField.GetValue(adapter)!;

public static IReadOnlyList<string>? GetParameterNames(this TestAdapter adapter)
{
var method = adapter.Method!;
Expand Down

0 comments on commit 41d3ddb

Please sign in to comment.