diff --git a/TUnit.Core/Discovery/ObjectGraphDiscoverer.cs b/TUnit.Core/Discovery/ObjectGraphDiscoverer.cs
index 96fb88747d..5d77386df0 100644
--- a/TUnit.Core/Discovery/ObjectGraphDiscoverer.cs
+++ b/TUnit.Core/Discovery/ObjectGraphDiscoverer.cs
@@ -148,7 +148,7 @@ public ObjectGraph DiscoverNestedObjectGraph(object rootObject, CancellationToke
/// The test context to discover objects from.
/// Cancellation token for the operation.
/// The tracked objects dictionary (same as testContext.TrackedObjects).
- public Dictionary> DiscoverAndTrackObjects(TestContext testContext, CancellationToken cancellationToken = default)
+ public SortedList> DiscoverAndTrackObjects(TestContext testContext, CancellationToken cancellationToken = default)
{
var visitedObjects = testContext.TrackedObjects;
@@ -212,7 +212,7 @@ void Recurse(object value, int depth)
///
private void DiscoverNestedObjectsForTracking(
object obj,
- Dictionary> visitedObjects,
+ IDictionary> visitedObjects,
int currentDepth,
CancellationToken cancellationToken)
{
@@ -264,7 +264,7 @@ private static bool ShouldSkipType(Type type)
///
/// Add to HashSet at specified depth. Returns true if added (not duplicate).
///
- private static bool TryAddToHashSet(Dictionary> dict, int depth, object obj)
+ private static bool TryAddToHashSet(IDictionary> dict, int depth, object obj)
{
var hashSet = dict.GetOrAdd(depth, _ => new HashSet