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

Sholtee / proxygen / 957

03 Apr 2025 03:49AM UTC coverage: 90.283% (+3.1%) from 87.222%
957

push

appveyor

Sholtee
fix method hash generation

4841 of 5362 relevant lines covered (90.28%)

0.9 hits per line

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

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

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

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

15
namespace Solti.Utils.Proxy.Internals
16
{
17
    internal partial class ClassSyntaxFactoryBase
18
    {
19
        /// <summary>
20
        /// <code>
21
        /// TypeName(T a, TT b, ...): base(a, b, ...) { }
22
        /// </code>
23
        /// </summary>
24
        #if DEBUG
25
        internal
26
        #endif
27
        protected ConstructorDeclarationSyntax ResolveConstructor(IConstructorInfo ctor, SyntaxToken name, params IEnumerable<ParameterSyntax> extraParams)
28
        {
1✔
29
            IReadOnlyList<IParameterInfo> paramz = ctor.Parameters;
1✔
30

31
            return ConstructorDeclaration
1✔
32
            (
1✔
33
                name
1✔
34
            )
1✔
35
            .WithModifiers
1✔
36
            (
1✔
37
                modifiers: TokenList
1✔
38
                (
1✔
39
                    Token(SyntaxKind.PublicKeyword)
1✔
40
                )
1✔
41
            )
1✔
42
            .WithParameterList
1✔
43
            (
1✔
44
                parameterList: ParameterList
1✔
45
                (
1✔
46
                    extraParams
1✔
47
                        .Concat
1✔
48
                        (
1✔
49
                            paramz.Select
1✔
50
                            (
1✔
51
                                param => Parameter
1✔
52
                                (
1✔
53
                                    identifier: Identifier(param.Name)
1✔
54
                                )
1✔
55
                                .WithType
1✔
56
                                (
1✔
57
                                    type: ResolveType(param.Type)
1✔
58
                                )
1✔
59
                            )
1✔
60
                        )
1✔
61
                        .ToSyntaxList()
1✔
62
                )
1✔
63
            )
1✔
64
            .WithInitializer
1✔
65
            (
1✔
66
                initializer: ConstructorInitializer
1✔
67
                (
1✔
68
                    SyntaxKind.BaseConstructorInitializer,
1✔
69
                    ArgumentList
1✔
70
                    (
1✔
71
                        paramz.ToSyntaxList
1✔
72
                        (
1✔
73
                            static param => Argument
1✔
74
                            (
1✔
75
                                expression: IdentifierName(param.Name)
1✔
76
                            )
1✔
77
                        )
1✔
78
                    )
1✔
79
                )
1✔
80
            )
1✔
81
            .WithBody(Block());
1✔
82
        }
1✔
83

84
        #if DEBUG
85
        internal
86
        #endif
87
        protected virtual ClassDeclarationSyntax ResolveConstructors(ClassDeclarationSyntax cls, object context) => cls;
1✔
88

89
        #if DEBUG
90
        internal
91
        #endif
92
        protected virtual ClassDeclarationSyntax ResolveConstructor(ClassDeclarationSyntax cls, object context, IConstructorInfo ctor) => cls;
×
93
    }
94
}
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

© 2025 Coveralls, Inc