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

Sholtee / proxygen / 1060

02 May 2025 09:09AM UTC coverage: 92.623% (-0.08%) from 92.705%
1060

push

appveyor

Sholtee
fix RoslynV3 ParameterList issue

4859 of 5246 relevant lines covered (92.62%)

0.93 hits per line

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

72.73
/SRC/Public/Generators/ClassProxyGenerator.cs
1
/********************************************************************************
2
* ClassProxyGenerator.cs                                                        *
3
*                                                                               *
4
* Author: Denes Solti                                                           *
5
********************************************************************************/
6
using System;
7
using System.Threading;
8
using System.Threading.Tasks;
9

10
using Tuple =
11
    #if NETSTANDARD2_1_OR_GREATER
12
    System.Runtime.CompilerServices.ITuple;
13
    #else
14
    object;
15
    #endif
16

17
namespace Solti.Utils.Proxy.Generators
18
{
19
    using Internals;
20

21
    /// <summary>
22
    /// Type generator for creating proxies that intercept class method calls.
23
    /// </summary>
24
    public sealed class ClassProxyGenerator(Type @class) : Generator(id: GenerateId(nameof(ClassProxyGenerator), @class))
1✔
25
    {
26
        /// <summary>
27
        /// The target class
28
        /// </summary>
29
        public Type Class { get; } = @class ?? throw new ArgumentNullException(nameof(@class));
1✔
30

31
        /// <summary>
32
        /// Activates the proxy type.
33
        /// </summary>
34
        public Task<object> ActivateAsync(IInterceptor interceptor, Tuple? ctorParamz, CancellationToken cancellation = default) =>
35
            ActivateAsync(System.Tuple.Create(interceptor, (object?) ctorParamz), cancellation);
1✔
36

37
        /// <summary>
38
        /// Activates the underlying proxy type.
39
        /// </summary>
40
        public object Activate(IInterceptor interceptor, Tuple? ctorParamz) => ActivateAsync(interceptor, ctorParamz, CancellationToken.None)
×
41
            .GetAwaiter()
×
42
            .GetResult();
×
43

44
        private protected override ProxyUnitSyntaxFactoryBase CreateMainUnit(SyntaxFactoryContext context) => new ClassProxySyntaxFactory
1✔
45
        (
1✔
46
            MetadataTypeInfo.CreateFrom(Class),
1✔
47
            context
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