Esempio n. 1
0
        public async Task RemoveQuestionFromSetAsync_WhenCalled_RemoveQuestionAsync()
        {
            var questionSet = _setUpContext.QuestionSets.Find(1, 1);

            await _setService.RemoveQuestionFromSetAsync(questionSet);

            var removedQuestionSet = _context.QuestionSets
                                     .FirstOrDefault(q => q.QuestionId == 1 && q.SetId == 1);

            Assert.That(removedQuestionSet, Is.Null);
        }
Esempio n. 2
0
        public async Task <IActionResult> OnPostDetachAsync(int?id)
        {
            try
            {
                await _setService.RemoveQuestionFromSetAsync(this.QuestionSet);
            }
            catch
            {
                NotFound();
            }

            return(RedirectToPage("Edit", new { id }));
        }