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

Sholtee / proxygen / 1032

26 Apr 2025 04:30AM UTC coverage: 92.643% (+1.0%) from 91.629%
1032

push

appveyor

Sholtee
+1 test case

4810 of 5192 relevant lines covered (92.64%)

0.93 hits per line

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

93.33
/SRC/Private/SyntaxFactories/ClassSyntaxFactoryBase.Constructor.cs
1
/********************************************************************************
2
* ClassSyntaxFactoryBase.Constructor.cs                                         *
3
*                                                                               *
4
* Author: Denes Solti                                                           *
5
********************************************************************************/
6
using System.Linq;
7

8
using Microsoft.CodeAnalysis;
9
using Microsoft.CodeAnalysis.CSharp;
10
using Microsoft.CodeAnalysis.CSharp.Syntax;
11

12
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
13

14
namespace Solti.Utils.Proxy.Internals
15
{
16
    internal partial class ClassSyntaxFactoryBase
17
    {
18
        /// <summary>
19
        /// <code>
20
        /// TypeName(T a, TT b, ...): base(a, b, ...) { }
21
        /// </code>
22
        /// </summary>
23
        #if DEBUG
24
        internal
25
        #endif
26
        protected ConstructorDeclarationSyntax ResolveConstructor(IConstructorInfo ctor, SyntaxToken name) => ConstructorDeclaration(name)
1✔
27
            .WithModifiers
1✔
28
            (
1✔
29
                modifiers: TokenList
1✔
30
                (
1✔
31
                    //
1✔
32
                    // Constructor argument may use nested protected/internal types
1✔
33
                    //
1✔
34

1✔
35
                    Token
1✔
36
                    (
1✔
37
                        ctor.Parameters.SelectMany(static param => param.Type.AccessModifiers.SetFlags()).DefaultIfEmpty().Min() switch
1✔
38
                        {
1✔
39
                            AccessModifiers.Protected => SyntaxKind.ProtectedKeyword,
×
40
                            AccessModifiers.Internal => SyntaxKind.InternalKeyword,
×
41
                            _ => SyntaxKind.PublicKeyword
1✔
42
                        }
1✔
43
                    )
1✔
44
                )
1✔
45
            )
1✔
46
            .WithParameterList
1✔
47
            (
1✔
48
                parameterList: ResolveParameterList(ctor)
1✔
49
            )
1✔
50
            .WithInitializer
1✔
51
            (
1✔
52
                initializer: ConstructorInitializer
1✔
53
                (
1✔
54
                    SyntaxKind.BaseConstructorInitializer,
1✔
55
                    ResolveArgumentList
1✔
56
                    (
1✔
57
                        ctor,
1✔
58
                        ctor.Parameters.Select
1✔
59
                        (
1✔
60
                            static param => Argument
1✔
61
                            (
1✔
62
                                expression: IdentifierName(param.Name)
1✔
63
                            )
1✔
64
                        )
1✔
65
                    )
1✔
66
                )
1✔
67
            )
1✔
68
            .WithBody(Block());
1✔
69

70
        #if DEBUG
71
        internal
72
        #endif
73
        protected virtual ClassDeclarationSyntax ResolveConstructors(ClassDeclarationSyntax cls, object context) => cls;
1✔
74

75
        #if DEBUG
76
        internal
77
        #endif
78
        protected virtual ClassDeclarationSyntax ResolveConstructor(ClassDeclarationSyntax cls, object context, IConstructorInfo ctor) => cls;
×
79
    }
80
}
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