public ActionResult UpdateChampion(UpdateChampionDto updateChampionDto) { Champion champion = new() { Id = updateChampionDto.Id, Name = updateChampionDto.Name, Ultimate = updateChampionDto.Ultimate }; championDao.UpdateChampion(champion); return(NoContent()); }
public void CreateChampion_NewItem_Success() { // Arrange var existingItem = CreateRandomChampion(); championDaoStub.Setup(stub => stub.GetChampion(It.IsAny <Guid>())).Returns(existingItem); var controller = new ChampionController(championDaoStub.Object); var id = existingItem.Id; var itemToUpdate = new UpdateChampionDto() { Id = Guid.NewGuid(), Name = Guid.NewGuid().ToString(), Ultimate = Guid.NewGuid().ToString() }; // Act var result = controller.UpdateChampion(itemToUpdate); // Assert result.Should().BeOfType <NoContentResult>(); }