public async Task <ActionResult <AccountTypeView> > CreateAccountType([FromBody] CreateAccountTypeCommand command) { var newAccountTypeId = await _Mediator.Send(command); var newAccountType = await _Mediator.Send(new GetAccountTypeQuery() { Id = newAccountTypeId }); return(StatusCode(201, newAccountType)); }
public async Task CreateAccountTypeSuccessfuly() { // Arrange CreateAccountTypeCommand command = new CreateAccountTypeCommand() { IsTypeOf = 2, Type = "Account Recievable", IsSummary = 1 }; CreateAccountTypeCommandHandler handler = new CreateAccountTypeCommandHandler(_Database); // Act var result = await handler.Handle(command, CancellationToken.None); // Assert Assert.NotEqual(0u, result); }
public void Handle(CreateAccountTypeCommand createCusomerCommand) { }