Skip to content

Pass generic type to AddMassTransitTestHarness #1

@stankansas

Description

@stankansas

We've add MassTransit using the specified ICrmBus like below

services
.AddMassTransit<ICrmBus>(configurator =>
{
    configurator.UsingAzureServiceBus((context, cfg) =>
    {
        cfg.ConfigureJsonSerializerOptions(x =>
        {
            x.Converters.Add(new JsonStringEnumConverter());
            return x;
        });

        cfg.MessageTopology.SetEntityNameFormatter(new PrefixEntityNameFormatter(cfg.MessageTopology.EntityNameFormatter, $"{environment}-"));
        cfg.Host(configuration.GetConnectionString("ServiceBus"));
    });
});

In our WebApplicationFactory unit test, AddMassTransitTestHarness doesn't support passing generic type i.e AddMassTransitTestHarness<ICrmBus> to override the old one.

I'm just wondering what's approach here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions