public void ShouldFailValidation()
        {
            var command = new RegisterStoreUser
            {
                IsOwner  = true,
                Password = "******",
                Username = "******"
            };

            FluentActions.Invoking(() =>
                                   SendAsync(command)).Should().Throw <ValidationException>();
        }
        public void ShouldSucceedValidation()
        {
            var command = new RegisterStoreUser
            {
                IsOwner  = true,
                Password = "******",
                Username = "******"
            };

            FluentActions.Invoking(() =>
                                   SendAsync(command)).Should().NotThrow();
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Register([FromForm] RegisterStoreUser register)
        {
            try
            {
                await Mediator.Send(register);

                return(Ok());
            }
            catch (Exception e)
            {
                return(BadRequestWithMessage(e.Message));
            }
        }
Exemplo n.º 4
0
 public static Task RegisterStoreUser(this IFlurlClient http, RegisterStoreUser model)
 {
     return(http.Request("api", "storeuser", "register")
            .PostUrlEncodedAsync(model));
 }