public async Task CanUpdateQuiz() { // Arrange: var toUpdate = await _sut.Get().FirstOrDefaultAsync(x => !x.Deleted); toUpdate.Name = "Changed Name"; // Act: var result = await _sut.UpdateAsync(toUpdate); // Assert: Assert.Equal(1, result); }
public async Task <int> UpdateAsync(QuestionViewModel entityToUpdate) { var map = _mapper.Map <EQuestion>(entityToUpdate); var updatedEntities = await _dal.UpdateAsync(map); return(updatedEntities); }
public async Task <int> UpdateAsync(QuizViewModel entityToUpdate) { //entityToUpdate.ModifiedBy = CurrentUserId; var map = _mapper.Map <EQuiz>(entityToUpdate); var updatedEntities = await _dal.UpdateAsync(map); return(updatedEntities); }
public async Task CanUpdateQuestion() { // Arrange: var toUpdate = await _sut.Get().FirstOrDefaultAsync(x => !x.Deleted); var x = new List <EQuiz>(); toUpdate.Text = "Changed question"; // Act: var result = await _sut.UpdateAsync(toUpdate); // Assert: Assert.Equal(1, result); }