コード例 #1
0
        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);
        }
コード例 #2
0
        public async Task <int> UpdateAsync(QuestionViewModel entityToUpdate)
        {
            var map             = _mapper.Map <EQuestion>(entityToUpdate);
            var updatedEntities = await _dal.UpdateAsync(map);

            return(updatedEntities);
        }
コード例 #3
0
        public async Task <int> UpdateAsync(QuizViewModel entityToUpdate)
        {
            //entityToUpdate.ModifiedBy = CurrentUserId;
            var map             = _mapper.Map <EQuiz>(entityToUpdate);
            var updatedEntities = await _dal.UpdateAsync(map);

            return(updatedEntities);
        }
コード例 #4
0
        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);
        }