• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ImmediatePlatform / Immediate.Cache / 26902992517

03 Jun 2026 05:54PM UTC coverage: 93.478%. First build
26902992517

Pull #106

github

web-flow
Merge f5d051ec1 into 7878112c1
Pull Request #106: Generator

179 of 196 new or added lines in 9 files covered. (91.33%)

344 of 368 relevant lines covered (93.48%)

3.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.75
/src/Immediate.Cache.Generators/ImmediateCacheGenerator.Transform.cs
1
using Microsoft.CodeAnalysis;
2

3
namespace Immediate.Cache.Generators;
4

5
public sealed partial class ImmediateCacheGenerator
6
{
7
        private static CacheDefinition? TransformCacheDefinition(GeneratorAttributeSyntaxContext context, CancellationToken token)
8
        {
9
                token.ThrowIfCancellationRequested();
4✔
10

11
                if (context.TargetSymbol is not INamedTypeSymbol { ContainingType: null } targetSymbol)
4✔
NEW
12
                        return null;
×
13

14
                if (context.Attributes is not [{ AttributeClass.TypeArguments: [INamedTypeSymbol { IsStatic: false } handlerSymbol] }])
4✔
15
                        return null;
4✔
16

17
                var @namespace = targetSymbol.ContainingNamespace.ToString().NullIf("<global namespace>");
4✔
18
                var name = targetSymbol.Name;
4✔
19

20
                if (!handlerSymbol.GetValidHandleMethod(out var requestType, out var responseType))
4✔
21
                        return null;
4✔
22

23
                return new CacheDefinition()
4✔
24
                {
4✔
25
                        Namespace = @namespace,
4✔
26
                        ClassName = name,
4✔
27
                        RequestType = requestType.ToDisplayString(DisplayNameFormatters.FullyQualifiedWithNullableFormat),
4✔
28
                        ResponseType = responseType.ToDisplayString(DisplayNameFormatters.FullyQualifiedWithNullableFormat),
4✔
29
                };
4✔
30
        }
31
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc