예제 #1
0
        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));
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
 public void ShouldThrowIfNoArguments(RemoveConfigCommand command)
 {
     Assert.Throws <CommandException>(() => command.Execute(new string[0]));
 }
예제 #4
0
        public void Remove(Guid id)
        {
            var removeCommand = new RemoveConfigCommand(id);

            Bus.SendCommand(removeCommand);
        }