public void WithId()
        {
            _commandWithId.Validate();


            Assert.AreEqual(_commandWithId.Valid, true);
        }
Beispiel #2
0
        public async Task <ICommandResult> HandleAsync(ApproveClientCommand command)
        {
            command.Validate();
            if (command.Invalid)
            {
                return(new GenericCommandResult <ClientEntity>(false, command.Notifications));
            }

            var client = await _repository.GetAsync(command.Id);

            client.SetApproved();
            await _repository.UpdateAsync(client);

            return(new GenericCommandResult <ClientEntity>(true, client));
        }
 public void WithoutId()
 {
     _commandWithoutId.Validate();
     Assert.AreEqual(_commandWithoutId.Valid, false);
 }