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

net-daemon / netdaemon / 17534250533

07 Sep 2025 09:41PM UTC coverage: 83.915% (-0.2%) from 84.091%
17534250533

Pull #1326

github

web-flow
Merge 6bf1a0fff into 25a52e371
Pull Request #1326: Support for Delegate style minimal Apps

858 of 1147 branches covered (74.8%)

Branch coverage included in aggregate %.

45 of 59 new or added lines in 12 files covered. (76.27%)

3 existing lines in 1 file now uncovered.

3352 of 3870 relevant lines covered (86.61%)

911.83 hits per line

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

78.95
/src/AppModel/NetDaemon.AppModel/Internal/AppFactories/ClassAppFactory.cs
1
using System.Reflection;
2

3
namespace NetDaemon.AppModel.Internal.AppFactories;
4

5
internal class ClassAppFactory(Type type, string? id = default, bool? focus = default) : IAppFactory
149✔
6
{
7
    public object Create(IServiceProvider provider)
8
    {
9
        return ActivatorUtilities.CreateInstance(provider, type);
109✔
10
    }
11

12
    public string Id { get; } = id ?? GetAppId(type);
559✔
13

14
    public bool HasFocus { get; } = focus ?? type.GetCustomAttribute<FocusAttribute>() is not null;
264!
15

16
    private static string GetAppId(Type type)
17
    {
18
        var attribute = type.GetCustomAttribute<NetDaemonAppAttribute>();
149✔
19
        var id = attribute?.Id ?? type.FullName;
149!
20

21
        if (string.IsNullOrEmpty(id))
149!
22
        {
NEW
23
            throw new InvalidOperationException($"Could not get app id from {type}");
×
24
        }
25

26
        return id;
149✔
27
    }
28
}
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