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

Sholtee / proxygen / 980

10 Apr 2025 02:40PM UTC coverage: 91.933% (+0.2%) from 91.686%
980

push

appveyor

Sholtee
test ClassProxyGenerator against system types, related fixes III

4866 of 5293 relevant lines covered (91.93%)

0.92 hits per line

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

94.44
/SRC/Private/SyntaxFactories/ClassProxySyntaxFactory.ConstructorFactory.cs
1
/********************************************************************************
2
* ClassProxySyntaxFactory.ConstructorFactory.cs                                 *
3
*                                                                               *
4
* Author: Denes Solti                                                           *
5
********************************************************************************/
6
using System;
7

8
using Microsoft.CodeAnalysis.CSharp.Syntax;
9

10
namespace Solti.Utils.Proxy.Internals
11
{
12
    using Properties;
13

14
    internal partial class ClassProxySyntaxFactory
15
    {
16
        #if DEBUG
17
        internal
18
        #endif
19
        protected override ClassDeclarationSyntax ResolveConstructors(ClassDeclarationSyntax cls, object context)
20
        {
1✔
21
            bool hasConstructor = false;
1✔
22
            foreach (IConstructorInfo ctor in TargetType.GetConstructors(AccessModifiers.Protected))
1✔
23
            {
1✔
24
                if (IsVisible(ctor))
1✔
25
                {
1✔
26
                    cls = ResolveConstructor(cls, context, ctor);
1✔
27
                    hasConstructor = true;
1✔
28
                }
1✔
29
            }
1✔
30

31
            if (!hasConstructor)
1✔
32
                throw new InvalidOperationException(string.Format(Resources.NO_ACCESSIBLE_CTOR, TargetType.Name));
×
33

34
            return cls;
1✔
35
        }
1✔
36

37
        /// <summary>
38
        /// <code>
39
        /// public MyClass(T param1, TT param2): base(param1, param2) {}
40
        /// </code>
41
        /// </summary>
42
        #if DEBUG
43
        internal
44
        #endif
45
        protected override ClassDeclarationSyntax ResolveConstructor(ClassDeclarationSyntax cls, object context, IConstructorInfo ctor) => cls.AddMembers
1✔
46
        (
1✔
47
            ResolveConstructor(ctor, cls.Identifier)
1✔
48
        );
1✔
49
    }
50
}
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