Skip to content
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
2 changes: 1 addition & 1 deletion TUnit.Core/Models/TestModels/AssemblyMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public record AssemblyMetadata
private static readonly ConcurrentDictionary<string, AssemblyMetadata> Cache = [];
public static AssemblyMetadata GetOrAdd(string name, Func<AssemblyMetadata> factory)
{
return Cache.GetOrAdd(name, _ => factory());
return Cache.GetOrAdd(name, static (_, factory) => factory(), factory);
}

public virtual bool Equals(AssemblyMetadata? other)
Expand Down
4 changes: 2 additions & 2 deletions TUnit.Core/Models/TestModels/ClassMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public static ClassMetadata GetOrAdd(string name, Func<ClassMetadata> factory)
}
return existing;
}

// Otherwise add new value
return Cache.GetOrAdd(name, _ => factory());
return Cache.GetOrAdd(name, static (_, factory) => factory(), factory);
}

public virtual bool Equals(ClassMetadata? other)
Expand Down
1 change: 0 additions & 1 deletion TUnit.Engine/Building/TestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,6 @@ public async Task<AbstractExecutableTest> BuildTestAsync(TestMetadata metadata,
return firstSkipAttribute?.Reason;
}


private async ValueTask<TestContext> CreateTestContextAsync(string testId, TestMetadata metadata, TestData testData, TestBuilderContext testBuilderContext)
{
// Use attributes from context if available, or create new ones
Expand Down
Loading