public async Task Handle_Handle_ReturnsFailedIfGroupNull()
        {
            var command = new CreateUpdateClientGroupCommand(null);
            var result  = await target.Handle(command);

            Assert.NotNull(result);
            Assert.False(result.IsSuccessful);
        }
        public async Task Handle_CallsRepository_WithPopulatedIdIfEmpty()
        {
            var command = new CreateUpdateClientGroupCommand(new ConfigurationClientGroup {
                GroupId = string.Empty
            });
            await target.Handle(command);

            configurationClientRepository.Verify(r => r.UpdateClientGroupAsync(It.Is <ConfigurationClientGroup>(g => !string.IsNullOrWhiteSpace(g.GroupId))));
        }
        public async Task Handle_CallsEventService()
        {
            var command = new CreateUpdateClientGroupCommand(new ConfigurationClientGroup {
                GroupId = groupId
            });
            await target.Handle(command);

            eventService.Verify(r => r.Publish(It.Is <ConfigurationClientGroupUpdatedEvent>(e => e.GroupId == groupId)));
        }
        public async Task Handle_CallsRepository()
        {
            var command = new CreateUpdateClientGroupCommand(new ConfigurationClientGroup {
                GroupId = groupId
            });
            await target.Handle(command);

            configurationClientRepository.Verify(r => r.UpdateClientGroupAsync(command.ClientGroup));
        }
        public async Task Handle_ReturnsSuccess()
        {
            var command = new CreateUpdateClientGroupCommand(new ConfigurationClientGroup {
                GroupId = groupId
            });
            var result = await target.Handle(command);

            Assert.NotNull(result);
            Assert.True(result.IsSuccessful);
        }