Skip to content

Test host as "builder"?Β #12

@joro550

Description

@joro550

I was wondering what your thoughts would be in having a "fluent" or "builder" type api for the Test host:

var host = new TestHost()
    .AddService<Service1>()
    .AddService<Service2>()
    .AddComponent<MyComponent>();

vs current:

var host = new TestHost();
host.AddService<Service1>();
host.AddService<Service2>();
host.AddComponent<MyComponent>();

Would make it look a lot nicer with multiple services, in essence we're using the AddComponent method as what is more generally called Build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions