using Microsoft.Extensions.DependencyInjection.Extensions;
using NSubstitute;
using ZB.MOM.WW.ScadaBridge.CentralUI.Services;
using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services;
namespace Microsoft.Extensions.DependencyInjection;
internal static class ConfigurationMutationTestExtensions
{
/// Registers the configuration command services with test doubles for auditing and transactions.
/// The service collection to add the registrations to.
/// The same service collection, for chaining.
public static IServiceCollection AddTestConfigurationMutations(this IServiceCollection services)
{
services.TryAddScoped();
services.TryAddScoped();
services.TryAddSingleton(_ => Substitute.For());
services.TryAddSingleton();
return services;
}
private sealed class RepositoryTransaction(IServiceScopeFactory scopes) : IConfigurationCommandTransaction
{
///
public async Task