You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
Currently creating a configure class and calling AddSiloBuilderConfigurator<T>() or AddClientBuilderConfigurator<T>() is the only way to configure TestClusterBuilder.
There are cases in which each test may want to just replace a service isolated just for itself, currently we have to create a class for each test which need to setup a fake service:
It would be so useful if AddSiloBuilderConfigurator and AddClientBuilderConfigurator have an overload like this void AddSiloBuilderConfigurator(Action<ISiloBuilder> configAction)
the usage would be like this:
[Fact]
public async Task Test1()
{
var myFakeService = new MyFakeService();
_builder.AddSiloBuilderConfigurator(siloBuilder =>
{
siloBuilder.Services.AddSingleton<IMyService>(myFakeService);
});
var cluster = _builder.Build();
cluster.Deploy();
myFakeService.SetData("test data");
}
I can prepare a pull request if you agree on this proposal.
The text was updated successfully, but these errors were encountered:
zeinali-ali
changed the title
[Proposal] Let AddSiloBuilderConfigurator has a overload which accept an Action to configure cluster
[Proposal] Let AddSiloBuilderConfigurator has an overload which accept an Action to configure cluster
May 16, 2024
Hi
Currently creating a configure class and calling
AddSiloBuilderConfigurator<T>()
orAddClientBuilderConfigurator<T>()
is the only way to configureTestClusterBuilder
.There are cases in which each test may want to just replace a service isolated just for itself, currently we have to create a class for each test which need to setup a fake service:
It would be so useful if
AddSiloBuilderConfigurator
andAddClientBuilderConfigurator
have an overload like thisvoid AddSiloBuilderConfigurator(Action<ISiloBuilder> configAction)
the usage would be like this:
I can prepare a pull request if you agree on this proposal.
The text was updated successfully, but these errors were encountered: