コード例 #1
0
        public void ShouldFailNotFound()
        {
            var command = new UpdateStoreUser {
                Id = "asdwqedg"
            };

            FluentActions.Invoking(() =>
                                   SendAsync(command)).Should().Throw <NotFoundException>();
        }
コード例 #2
0
        public async Task ShouldUpdateAsync()
        {
            var id = await GetRandomOwner();

            var commad = new UpdateStoreUser {
                Id = id, NewUsername = "******", Password = "******", NewPassword = "******"
            };

            FluentActions.Invoking(() =>
                                   SendAsync(commad)).Should().NotThrow();
        }
コード例 #3
0
        public async Task <IActionResult> Update([FromForm] UpdateStoreUser update)
        {
            try
            {
                await Mediator.Send(update);

                return(Ok());
            }
            catch (Exception e)
            {
                return(BadRequestWithMessage(e.Message));
            }
        }
コード例 #4
0
 public static Task UpdateStoreUser(this IFlurlClient http, UpdateStoreUser model)
 {
     return(http.Request("api", "storeuser", "update")
            .PostUrlEncodedAsync(model));
 }