public void EditKudosBasket(KudosBasketEditDTO editedBasket) { var basketToEdit = _kudosBasketsDbSet .First(basket => basket.Id == editedBasket.Id); basketToEdit.Title = editedBasket.Title; basketToEdit.Description = editedBasket.Description; basketToEdit.IsActive = editedBasket.IsActive; basketToEdit.Modified = DateTime.UtcNow; basketToEdit.ModifiedBy = editedBasket.UserId; _uow.SaveChanges(); }
public void Should_Edit_Existing_Kudos_Basket() { var kudosBasketDto = new KudosBasketEditDTO { Id = 10, IsActive = false, Description = "edited", Title = "edited", UserId = "testUserId" }; _kudosBasketService.EditKudosBasket(kudosBasketDto); var editedBasket = _kudosBasketDbSet.First(basket => basket.Id == 10); Assert.AreEqual(kudosBasketDto.Title, editedBasket.Title); Assert.AreEqual(kudosBasketDto.Description, editedBasket.Description); Assert.AreEqual(kudosBasketDto.IsActive, editedBasket.IsActive); Assert.AreEqual("testUserId", editedBasket.ModifiedBy); }