예제 #1
0
        private async Task Renamed_CustomField_Persists_The_New_Name()
        {
            // GIVEN a custom field
            var customFieldRef = await CreateSampleCustomField();

            // WHEN renaming it
            var response = await _commandService.Update(customFieldRef.Id, new CustomFieldUpdateRequest { Name = "New name" });

            await SaveChanges();

            // THEN
            // renaming was successful
            Assert.True(response.IsSuccess);
            // the entity appears in the DB with the new name
            var record = (await _queryService.GetById(customFieldRef.Id)).Value;

            Assert.Equal("New name", record.Name);
        }
예제 #2
0
 public Task <ActionResult <CustomFieldReferenceDto> > Update([FromServices] ICustomFieldCommandService service,
                                                              [FromRoute] string id,
                                                              CustomFieldUpdateRequest dto)
 => service.Update(id, dto).ToActionResultOfT();