Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ConstructorArgumentsShouldMatchAnalyzer test cases to make sure all positive and negative cases are covered #124

Merged

Conversation

rjmurillo
Copy link
Owner

@rjmurillo rjmurillo commented Jun 25, 2024

This is comprehensive and did not change the code coverage numbers.

Resolves #123

There are still blocks that are not covered:

if (typeSyntax is QualifiedNameSyntax qualifiedNameSyntax)
{
return qualifiedNameSyntax.Right as GenericNameSyntax;
}
return null;

The return null cases

private static INamedTypeSymbol? GetMockedSymbol(
SyntaxNodeAnalysisContext context,
GenericNameSyntax genericName)
{
SeparatedSyntaxList<TypeSyntax> typeArguments = genericName.TypeArgumentList.Arguments;
if (typeArguments.Count != 1) return null;
SymbolInfo mockedTypeSymbolInfo = context.SemanticModel.GetSymbolInfo(typeArguments[0], context.CancellationToken);
if (mockedTypeSymbolInfo.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Class } mockedTypeSymbol) return null;
return mockedTypeSymbol;
}

…vered

This is comprehensive and did not change the code coverage number.
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) (target: 95.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (e3e5dec) 423 392 92.67%
Head commit (dbf13f9) 423 (+0) 392 (+0) 92.67% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#124) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences


🚀 Don’t miss a bit, follow what’s new on Codacy.

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@rjmurillo rjmurillo added this to the 0.2.0 milestone Jun 25, 2024
@rjmurillo rjmurillo marked this pull request as ready for review June 25, 2024 17:41
@rjmurillo rjmurillo requested a review from MattKotsenas June 25, 2024 17:41
@rjmurillo rjmurillo enabled auto-merge (squash) June 25, 2024 17:55
@rjmurillo rjmurillo merged commit be45e11 into main Jun 25, 2024
7 checks passed
@rjmurillo rjmurillo deleted the bug/123-reduce-test-cases-by-picking-a-value-for-mockbehavior branch June 25, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce test cases by picking a value for MockBehavior
2 participants