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

ImmediatePlatform / Immediate.Cache / 26905363819

03 Jun 2026 06:38PM UTC coverage: 93.733% (-2.4%) from 96.154%
26905363819

push

github

web-flow
Add `Immediate.Cache` Generator (#106)

179 of 195 new or added lines in 9 files covered. (91.79%)

344 of 367 relevant lines covered (93.73%)

3.75 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