public void ShouldRemoveConfigurationVariables(string arguments, [Frozen] Mock <IApplicationConfiguration> applicationConfiguration, [Frozen] Mock <IAppHarborClient> client, RemoveConfigCommand command, string applicationId) { applicationConfiguration.Setup(x => x.GetApplicationId()).Returns(applicationId); var keysToDelete = arguments.Split(); command.Execute(keysToDelete); foreach (var key in keysToDelete) { client.Verify(x => x.RemoveConfigurationVariable(applicationId, key)); } }
public Task Handle(RemoveConfigCommand message, CancellationToken cancellationToken) { if (!message.IsValid()) { NotifyValidationErrors(message); return(Task.CompletedTask); } _ConfigRepository.Remove(message.Id); if (Commit()) { Bus.RaiseEvent(new ConfigRemovedEvent(message.Id)); } return(Task.CompletedTask); }
public void ShouldThrowIfNoArguments(RemoveConfigCommand command) { Assert.Throws <CommandException>(() => command.Execute(new string[0])); }
public void Remove(Guid id) { var removeCommand = new RemoveConfigCommand(id); Bus.SendCommand(removeCommand); }