Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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.Analyzers.CodeFixers/Base/AssertionRewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected AssertionRewriter(SemanticModel semanticModel)
// Conversion added trivia (TODO comments). Structure should be:
// [original whitespace] [TODO comment] [newline] [original whitespace] [await expression]
var whitespaceTrivia = originalTrivia.Where(t => t.IsKind(SyntaxKind.WhitespaceTrivia)).ToList();
var nonWhitespaceTrivia = originalTrivia.Where(t => !t.IsKind(SyntaxKind.WhitespaceTrivia)).ToList();
var nonWhitespaceTrivia = originalTrivia.Where(t => !t.IsKind(SyntaxKind.WhitespaceTrivia));

var builder = new List<SyntaxTrivia>();
builder.AddRange(nonWhitespaceTrivia); // Add any non-whitespace (e.g., leading newlines)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
compilationUnit = CleanupEndOfFileTrivia(compilationUnit);

// Normalize line endings to match original document (fixes cross-platform issues)
compilationUnit = NormalizeLineEndings(compilationUnit, root);

Check warning on line 211 in TUnit.Analyzers.CodeFixers/Base/BaseMigrationCodeFixProvider.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (macos-latest)

Possible null reference argument for parameter 'originalRoot' in 'CompilationUnitSyntax BaseMigrationCodeFixProvider.NormalizeLineEndings(CompilationUnitSyntax compilationUnit, SyntaxNode originalRoot)'.

Check warning on line 211 in TUnit.Analyzers.CodeFixers/Base/BaseMigrationCodeFixProvider.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (windows-latest)

Possible null reference argument for parameter 'originalRoot' in 'CompilationUnitSyntax BaseMigrationCodeFixProvider.NormalizeLineEndings(CompilationUnitSyntax compilationUnit, SyntaxNode originalRoot)'.

// Add TODO comments for any failures so users know what needs manual attention
if (context.HasFailures)
Expand Down Expand Up @@ -545,12 +545,11 @@
!t.IsKind(SyntaxKind.WhitespaceTrivia));

var newTrivia = trailingTrivia
.Where(t => !t.IsKind(SyntaxKind.EndOfLineTrivia))
.ToList();
.Where(t => !t.IsKind(SyntaxKind.EndOfLineTrivia));

if (hasContentAfterLastMember)
{
newTrivia.Add(SyntaxFactory.EndOfLine("\n"));

Check failure on line 552 in TUnit.Analyzers.CodeFixers/Base/BaseMigrationCodeFixProvider.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (de-DE)

"IEnumerable<SyntaxTrivia>" enthält keine Definition für "Add", und es konnte keine zugängliche Add-Erweiterungsmethode gefunden werden, die ein erstes Argument vom Typ "IEnumerable<SyntaxTrivia>" akzeptiert (möglicherweise fehlt eine using-Direktive oder ein Assemblyverweis).

Check failure on line 552 in TUnit.Analyzers.CodeFixers/Base/BaseMigrationCodeFixProvider.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (de-DE)

"IEnumerable<SyntaxTrivia>" enthält keine Definition für "Add", und es konnte keine zugängliche Add-Erweiterungsmethode gefunden werden, die ein erstes Argument vom Typ "IEnumerable<SyntaxTrivia>" akzeptiert (möglicherweise fehlt eine using-Direktive oder ein Assemblyverweis).

Check failure on line 552 in TUnit.Analyzers.CodeFixers/Base/BaseMigrationCodeFixProvider.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (pl-PL)

Element „IEnumerable<SyntaxTrivia>” nie zawiera definicji „Add” i nie odnaleziono dostępnej metody rozszerzenia „Add”, która przyjmuje pierwszy argument typu „IEnumerable<SyntaxTrivia>” (czy nie brakuje dyrektywy using lub odwołania do zestawu?).

Check failure on line 552 in TUnit.Analyzers.CodeFixers/Base/BaseMigrationCodeFixProvider.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (pl-PL)

Element „IEnumerable<SyntaxTrivia>” nie zawiera definicji „Add” i nie odnaleziono dostępnej metody rozszerzenia „Add”, która przyjmuje pierwszy argument typu „IEnumerable<SyntaxTrivia>” (czy nie brakuje dyrektywy using lub odwołania do zestawu?).

Check failure on line 552 in TUnit.Analyzers.CodeFixers/Base/BaseMigrationCodeFixProvider.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (fr-FR)

'IEnumerable<SyntaxTrivia>' ne contient pas de définition pour 'Add' et aucune méthode d'extension accessible 'Add' acceptant un premier argument de type 'IEnumerable<SyntaxTrivia>' n'a été trouvée (une directive using ou une référence d'assembly est-elle manquante ?)

Check failure on line 552 in TUnit.Analyzers.CodeFixers/Base/BaseMigrationCodeFixProvider.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (fr-FR)

'IEnumerable<SyntaxTrivia>' ne contient pas de définition pour 'Add' et aucune méthode d'extension accessible 'Add' acceptant un premier argument de type 'IEnumerable<SyntaxTrivia>' n'a été trouvée (une directive using ou une référence d'assembly est-elle manquante ?)

Check failure on line 552 in TUnit.Analyzers.CodeFixers/Base/BaseMigrationCodeFixProvider.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (macos-latest)

'IEnumerable<SyntaxTrivia>' does not contain a definition for 'Add' and no accessible extension method 'Add' accepting a first argument of type 'IEnumerable<SyntaxTrivia>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 552 in TUnit.Analyzers.CodeFixers/Base/BaseMigrationCodeFixProvider.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (macos-latest)

'IEnumerable<SyntaxTrivia>' does not contain a definition for 'Add' and no accessible extension method 'Add' accepting a first argument of type 'IEnumerable<SyntaxTrivia>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 552 in TUnit.Analyzers.CodeFixers/Base/BaseMigrationCodeFixProvider.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (windows-latest)

'IEnumerable<SyntaxTrivia>' does not contain a definition for 'Add' and no accessible extension method 'Add' accepting a first argument of type 'IEnumerable<SyntaxTrivia>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 552 in TUnit.Analyzers.CodeFixers/Base/BaseMigrationCodeFixProvider.cs

View workflow job for this annotation

GitHub Actions / modularpipeline (windows-latest)

'IEnumerable<SyntaxTrivia>' does not contain a definition for 'Add' and no accessible extension method 'Add' accepting a first argument of type 'IEnumerable<SyntaxTrivia>' could be found (are you missing a using directive or an assembly reference?)
}

var newLastMember = lastMember.WithTrailingTrivia(newTrivia);
Expand Down
3 changes: 1 addition & 2 deletions TUnit.Analyzers.CodeFixers/Base/TestAttributeEnsurer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ private static MethodDeclarationSyntax AddTestAttribute(MethodDeclarationSyntax
// Strip newlines from first attribute's leading trivia, keep only indentation
// This prevents double newlines when we insert [Test] before it
var strippedTrivia = firstAttributeList.GetLeadingTrivia()
.Where(t => !t.IsKind(SyntaxKind.EndOfLineTrivia))
.ToList();
.Where(t => !t.IsKind(SyntaxKind.EndOfLineTrivia));
var updatedFirstAttr = firstAttributeList.WithLeadingTrivia(strippedTrivia);

// Build new attribute list: [Test], then updated first attr (with stripped trivia), then rest
Expand Down
8 changes: 4 additions & 4 deletions TUnit.Analyzers.CodeFixers/Base/TwoPhase/MigrationAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ protected bool IsInterfaceImplementation(TextSpan methodSpan)
protected virtual CompilationUnitSyntax AnalyzeAssertions(CompilationUnitSyntax root)
{
// Find assertions on the ORIGINAL tree (for semantic analysis)
var assertionNodes = FindAssertionNodes(_originalRoot).ToList();
var assertionNodes = FindAssertionNodes(_originalRoot);
var currentRoot = root;

foreach (var originalNode in assertionNodes)
Expand Down Expand Up @@ -238,7 +238,7 @@ private static bool ContainingMethodHasRefOrOutParameters(SyntaxNode node)
/// </summary>
protected virtual CompilationUnitSyntax AnalyzeAttributes(CompilationUnitSyntax root)
{
var attributeNodes = _originalRoot.DescendantNodes().OfType<AttributeSyntax>().ToList();
var attributeNodes = _originalRoot.DescendantNodes().OfType<AttributeSyntax>();
var currentRoot = root;

foreach (var originalNode in attributeNodes)
Expand Down Expand Up @@ -311,7 +311,7 @@ protected virtual CompilationUnitSyntax AnalyzeAttributes(CompilationUnitSyntax
/// </summary>
protected virtual CompilationUnitSyntax AnalyzeParameterAttributes(CompilationUnitSyntax root)
{
var parameterNodes = _originalRoot.DescendantNodes().OfType<ParameterSyntax>().ToList();
var parameterNodes = _originalRoot.DescendantNodes().OfType<ParameterSyntax>();
var currentRoot = root;

foreach (var parameter in parameterNodes)
Expand Down Expand Up @@ -379,7 +379,7 @@ protected virtual CompilationUnitSyntax AnalyzeMethodsForMissingAttributes(Compi
/// </summary>
protected virtual CompilationUnitSyntax AnalyzeBaseTypes(CompilationUnitSyntax root)
{
var classNodes = _originalRoot.DescendantNodes().OfType<ClassDeclarationSyntax>().ToList();
var classNodes = _originalRoot.DescendantNodes().OfType<ClassDeclarationSyntax>();
var currentRoot = root;

foreach (var classNode in classNodes)
Expand Down
4 changes: 2 additions & 2 deletions TUnit.Analyzers.CodeFixers/NUnitAssertMultipleRewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private SyntaxNode ConvertAssertMultipleLambda(ExpressionStatementSyntax origina
if (lambda.Body is BlockSyntax block)
{
// Visit each statement to convert inner assertions
var convertedStatements = block.Statements.Select(s => (StatementSyntax)Visit(s)!).ToArray();
var convertedStatements = block.Statements.Select(s => (StatementSyntax)Visit(s)!);
statements = SyntaxFactory.List(convertedStatements);
}
else if (lambda.Body is ExpressionSyntax expr)
Expand All @@ -67,7 +67,7 @@ private SyntaxNode ConvertAssertMultipleSimpleLambda(ExpressionStatementSyntax o
SyntaxList<StatementSyntax> statements;
if (lambda.Body is BlockSyntax block)
{
var convertedStatements = block.Statements.Select(s => (StatementSyntax)Visit(s)!).ToArray();
var convertedStatements = block.Statements.Select(s => (StatementSyntax)Visit(s)!);
statements = SyntaxFactory.List(convertedStatements);
}
else if (lambda.Body is ExpressionSyntax expr)
Expand Down
4 changes: 2 additions & 2 deletions TUnit.Analyzers.CodeFixers/NUnitMigrationCodeFixProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ private SyntaxNode ConvertAssertMultipleLambda(ExpressionStatementSyntax origina
if (lambda.Body is BlockSyntax block)
{
// Visit each statement to convert inner assertions
var convertedStatements = block.Statements.Select(s => (StatementSyntax)Visit(s)!).ToArray();
var convertedStatements = block.Statements.Select(s => (StatementSyntax)Visit(s)!);
statements = SyntaxFactory.List(convertedStatements);
}
else if (lambda.Body is ExpressionSyntax expr)
Expand All @@ -706,7 +706,7 @@ private SyntaxNode ConvertAssertMultipleSimpleLambda(ExpressionStatementSyntax o
SyntaxList<StatementSyntax> statements;
if (lambda.Body is BlockSyntax block)
{
var convertedStatements = block.Statements.Select(s => (StatementSyntax)Visit(s)!).ToArray();
var convertedStatements = block.Statements.Select(s => (StatementSyntax)Visit(s)!);
statements = SyntaxFactory.List(convertedStatements);
}
else if (lambda.Body is ExpressionSyntax expr)
Expand Down
17 changes: 6 additions & 11 deletions TUnit.Analyzers.CodeFixers/TwoPhase/XUnitTwoPhaseAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ private static string GetAttributeName(AttributeSyntax attribute)

protected override CompilationUnitSyntax AnalyzeBaseTypes(CompilationUnitSyntax root)
{
var classNodes = OriginalRoot.DescendantNodes().OfType<ClassDeclarationSyntax>().ToList();
var classNodes = OriginalRoot.DescendantNodes().OfType<ClassDeclarationSyntax>();
var currentRoot = root;

foreach (var classNode in classNodes)
Expand Down Expand Up @@ -1481,8 +1481,7 @@ protected override CompilationUnitSyntax AnalyzeMembers(CompilationUnitSyntax ro
var members = OriginalRoot.DescendantNodes()
.Where(n =>
(n is PropertyDeclarationSyntax prop && IsTestOutputHelperType(prop.Type)) ||
(n is FieldDeclarationSyntax field && IsTestOutputHelperType(field.Declaration.Type)))
.ToList();
(n is FieldDeclarationSyntax field && IsTestOutputHelperType(field.Declaration.Type)));

foreach (var originalMember in members)
{
Expand Down Expand Up @@ -1553,8 +1552,7 @@ protected override CompilationUnitSyntax AnalyzeConstructorParameters(Compilatio
// Find parameters on ORIGINAL tree (for semantic analysis)
var parameters = OriginalRoot.DescendantNodes()
.OfType<ParameterSyntax>()
.Where(p => p.Type != null && IsTestOutputHelperType(p.Type))
.ToList();
.Where(p => p.Type != null && IsTestOutputHelperType(p.Type));

foreach (var originalParam in parameters)
{
Expand Down Expand Up @@ -1625,8 +1623,7 @@ private CompilationUnitSyntax AnalyzeRecordExceptionCalls(CompilationUnitSyntax
// Find Record.Exception calls on the ORIGINAL tree
var recordExceptionCalls = OriginalRoot.DescendantNodes()
.OfType<InvocationExpressionSyntax>()
.Where(IsRecordExceptionCall)
.ToList();
.Where(IsRecordExceptionCall);

foreach (var originalCall in recordExceptionCalls)
{
Expand Down Expand Up @@ -1737,8 +1734,7 @@ private CompilationUnitSyntax AnalyzeTestOutputHelperCalls(CompilationUnitSyntax
// Find ITestOutputHelper.WriteLine calls on the ORIGINAL tree
var testOutputHelperCalls = OriginalRoot.DescendantNodes()
.OfType<InvocationExpressionSyntax>()
.Where(IsTestOutputHelperWriteLineCall)
.ToList();
.Where(IsTestOutputHelperWriteLineCall);

foreach (var originalCall in testOutputHelperCalls)
{
Expand Down Expand Up @@ -1826,8 +1822,7 @@ protected override CompilationUnitSyntax AnalyzeTheoryData(CompilationUnitSyntax
// Find all TheoryData<T> types in the original tree (field and property declarations)
var theoryDataNodes = OriginalRoot.DescendantNodes()
.OfType<GenericNameSyntax>()
.Where(g => g.Identifier.Text == "TheoryData")
.ToList();
.Where(g => g.Identifier.Text == "TheoryData");

foreach (var originalGeneric in theoryDataNodes)
{
Expand Down
3 changes: 1 addition & 2 deletions TUnit.Analyzers/AssemblyTestHooksAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ private void AnalyzeSymbol(SymbolAnalysisContext context)
var attributes = methodSymbol.GetAttributes();

var onlyOnceAttributes = attributes
.Where(x => x.IsStandardHook(context.Compilation, out _, out var level, out _) && level == HookLevel.Assembly)
.ToList();
.Where(x => x.IsStandardHook(context.Compilation, out _, out var level, out _) && level == HookLevel.Assembly);

if (!onlyOnceAttributes.Any())
{
Expand Down
3 changes: 1 addition & 2 deletions TUnit.Analyzers/ClassHooksAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ private void AnalyzeSymbol(SymbolAnalysisContext context)
var attributes = methodSymbol.GetAttributes();

var onlyOnceAttributes = attributes
.Where(x => x.IsStandardHook(context.Compilation, out _, out var level, out _) && level == HookLevel.Class)
.ToList();
.Where(x => x.IsStandardHook(context.Compilation, out _, out var level, out _) && level == HookLevel.Class);

if (!onlyOnceAttributes.Any())
{
Expand Down
6 changes: 2 additions & 4 deletions TUnit.Analyzers/CombinedDataSourceAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ private void CheckCombinedDataSourceErrors(SymbolAnalysisContext context,
x.IsCombinedDataSourceAttribute(context.Compilation));

var parametersWithDataSources = parameters
.Where(p => p.HasDataSourceAttribute(context.Compilation))
.ToList();
.Where(p => p.HasDataSourceAttribute(context.Compilation));

// Rule 1: If parameters have data source attributes, CombinedDataSources must be present
if (parametersWithDataSources.Any() && !hasCombinedDataSource)
Expand All @@ -81,8 +80,7 @@ private void CheckCombinedDataSourceErrors(SymbolAnalysisContext context,
// Filter out CancellationToken parameters as they're handled by the engine
var nonCancellationTokenParams = parameters
.Where(p => p.Type.GloballyQualifiedNonGeneric() !=
"global::System.Threading.CancellationToken")
.ToList();
"global::System.Threading.CancellationToken");

foreach (var parameter in nonCancellationTokenParams)
{
Expand Down
4 changes: 2 additions & 2 deletions TUnit.Analyzers/DisposableFieldPropertyAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private static void CheckFieldInitializers(SyntaxNodeAnalysisContext context, IN
private static void CheckSetUps(SyntaxNodeAnalysisContext context, IMethodSymbol methodSymbol, ConcurrentDictionary<ISymbol, HookLevel?> createdObjects)
{
var syntaxNodes = methodSymbol.DeclaringSyntaxReferences
.SelectMany(x => x.GetSyntax().DescendantNodesAndSelf()).ToArray();
.SelectMany(x => x.GetSyntax().DescendantNodesAndSelf());

var isHookMethod = methodSymbol.IsHookMethod(context.Compilation, out _, out var level, out _);

Expand Down Expand Up @@ -227,7 +227,7 @@ private static void CheckSetUps(SyntaxNodeAnalysisContext context, IMethodSymbol
private static void CheckTeardowns(SyntaxNodeAnalysisContext context, IMethodSymbol methodSymbol, ConcurrentDictionary<ISymbol, HookLevel?> createdObjects)
{
var syntaxNodes = methodSymbol.DeclaringSyntaxReferences
.SelectMany(x => x.GetSyntax().DescendantNodesAndSelf()).ToArray();
.SelectMany(x => x.GetSyntax().DescendantNodesAndSelf());

foreach (var assignment in syntaxNodes
.Where(x => x.IsKind(SyntaxKind.InvocationExpression)))
Expand Down
3 changes: 1 addition & 2 deletions TUnit.Analyzers/InstanceTestHooksAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ private void AnalyzeSymbol(SymbolAnalysisContext context)
var attributes = methodSymbol.GetAttributes();

var onlyOnceAttributes = attributes
.Where(x => x.IsStandardHook(context.Compilation, out _, out var level, out _) && level == HookLevel.Test)
.ToList();
.Where(x => x.IsStandardHook(context.Compilation, out _, out var level, out _) && level == HookLevel.Test);

if (!onlyOnceAttributes.Any())
{
Expand Down
4 changes: 2 additions & 2 deletions TUnit.Analyzers/SingleTUnitAttributeAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ private void AnalyzeSymbol(SymbolAnalysisContext context)

var attributes = symbol.GetAttributes();

var singleAttributes = attributes.Select(ToClassInheritingSingleAttribute).OfType<INamedTypeSymbol>().ToList();
var singleAttributes = attributes.Select(ToClassInheritingSingleAttribute).OfType<INamedTypeSymbol>();

var notDistinctAttributes = singleAttributes.GroupBy(x => x, SymbolEqualityComparer.Default).Where(x => x.Count() > 1).Select(x => x.Key!).ToList();
var notDistinctAttributes = singleAttributes.GroupBy(x => x, SymbolEqualityComparer.Default).Where(x => x.Count() > 1).Select(x => x.Key!);

foreach (var notDistinctAttribute in notDistinctAttributes)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,7 @@ private static void GenerateAssertionsForSpecificClass(SourceProductionContext c
.OfType<IPropertySymbol>()
.Where(p => p.Type.SpecialType == SpecialType.System_Boolean &&
p is { GetMethod: not null, IsStatic: false } &&
SymbolEqualityComparer.Default.Equals(p.ContainingType, attributeData.TargetType))
.ToList();
SymbolEqualityComparer.Default.Equals(p.ContainingType, attributeData.TargetType));

var matchingMethods = methodMembers.ToList();

Expand Down
8 changes: 3 additions & 5 deletions TUnit.Core.SourceGenerator/CodeGenerationHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static string GenerateAttributeInstantiation(AttributeData attr, Immutabl
syntaxIndex++;
elementIndex++;
return TypedConstantParser.GetRawTypedConstantValue(v, paramType);
}).ToList();
});
argStrings.AddRange(elements);
}
}
Expand Down Expand Up @@ -287,8 +287,7 @@ public static string GenerateTestAttributes(IMethodSymbol methodSymbol)

// Group attributes by type
var attributesByType = allAttributes
.GroupBy(attr => attr.AttributeClass?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) ?? "System.Attribute")
.ToList();
.GroupBy(attr => attr.AttributeClass?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) ?? "System.Attribute");

using var writer = new CodeWriter("", includeHeader: false);

Expand All @@ -301,12 +300,11 @@ public static string GenerateTestAttributes(IMethodSymbol methodSymbol)
foreach (var group in attributesByType)
{
var typeString = group.Key;
var attrs = group.ToList();

writer.Append($"[typeof({typeString})] = new global::System.Attribute[] {{ ");

var attributeStrings = new List<string>();
foreach (var attr in attrs)
foreach (var attr in group)
{
attributeStrings.Add(GenerateAttributeInstantiation(attr));
}
Expand Down
3 changes: 1 addition & 2 deletions TUnit.Core/Extensions/ReflectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ private static Attribute[] GetAttributesViaCustomAttributeData(ICustomAttributeP
var filteredList = customAttributeDataList
.Where(x => attributeType == typeof(Attribute) || (inherit
? x.AttributeType.IsAssignableTo(attributeType)
: x.AttributeType == attributeType))
.ToList();
: x.AttributeType == attributeType));

foreach (var attributeData in filteredList)
{
Expand Down
3 changes: 1 addition & 2 deletions TUnit.Engine/Building/TestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,8 +1179,7 @@ private AbstractExecutableTest CreateFailedTestForClassDataSourceCircularDepende
{
var instanceClassDataSources = metadata.ClassDataSources
.Where(ds => ds is IAccessesInstanceData)
.Select(ds => ds.GetType().Name)
.ToList();
.Select(ds => ds.GetType().Name);

var dataSourceNames = string.Join(", ", instanceClassDataSources);
var genericParams = string.Join(", ", metadata.TestClassType.GetGenericArguments().Select(t => t.Name));
Expand Down
Loading