• 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/InterfaceProxyGenerator.cs
1
/********************************************************************************
2
* InterfaceProxyGenerator.cs                                                    *
3
*                                                                               *
4
* Author: Denes Solti                                                           *
5
********************************************************************************/
6
using System;
7
using System.Threading;
8
using System.Threading.Tasks;
9

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

14
    /// <summary>
15
    /// Creates a new <see cref="InterfaceProxyGenerator"/> instance which hooks into the given <paramref name="interface"/>.
16
    /// </summary>
17
    /// <param name="interface">The interface to be proxied</param>
18
    public sealed class InterfaceProxyGenerator(Type @interface) : Generator(id: GenerateId(nameof(InterfaceProxyGenerator), @interface))
1✔
19
    {
20
        /// <summary>
21
        /// The target class or interface for which the proxy will be created.
22
        /// </summary>
23
        public Type Interface { get; } = @interface ?? throw new ArgumentNullException(nameof(@interface));
1✔
24

25
        /// <summary>
26
        /// Activates the proxy type.
27
        /// </summary>
28
        public Task<object> ActivateAsync(IInterceptor interceptor, object? target = null, CancellationToken cancellation = default) =>
29
            ActivateAsync(Tuple.Create(interceptor, target), cancellation);
1✔
30

31
        /// <summary>
32
        /// Activates the underlying duck type.
33
        /// </summary>
34
        public object Activate(IInterceptor interceptor, object? target = null) => ActivateAsync(interceptor, target, CancellationToken.None)
×
35
            .GetAwaiter()
×
36
            .GetResult();
×
37

38
        private protected override ProxyUnitSyntaxFactoryBase CreateMainUnit(SyntaxFactoryContext context) => new InterfaceProxySyntaxFactory
1✔
39
        (
1✔
40
            MetadataTypeInfo.CreateFrom(Interface),
1✔
41
            context
1✔
42
        );
1✔
43
    }
44
}
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