public static void ClearTenantConfig(this ICakeContext context, ClearTenantArgs args) { DependencyConfig.Setup(args, context).GetAwaiter().GetResult(); var cmd = DependencyConfig.Container.GetService <ClearTenantCommand>(); cmd.Execute().GetAwaiter().GetResult(); }
public TenantClearer(ClearTenantArgs args, IOctopusAsyncRepository octopusRepository) { _args = args ?? throw new ArgumentNullException(nameof(args)); _octopusRepository = octopusRepository ?? throw new ArgumentNullException(nameof(octopusRepository)); }
public async Task ClearTenantArgsAddedAndSubTypes(Mock <IServiceCollection> mockColl, ClearTenantArgs args) { await DependencyConfig.Setup(args, null, mockColl.Object, false).ConfigureAwait(false); mockColl.Verify(m => m.Add(It.Is <ServiceDescriptor>(s => s.ServiceType == typeof(ClearTenantArgs))), Times.Once); mockColl.Verify(m => m.Add(It.Is <ServiceDescriptor>(s => s.ServiceType == typeof(ArgsBase))), Times.Once); }