Inheritance: IQuizDto
Ejemplo n.º 1
0
 public QuizRepositoryTest()
 {
     _context = A.Fake<EasyTeachContext>();
     _quizRepository = new QuizRepository(_context);
     _quizDto = new QuizDto { QuizId = QuizId, Questions = new List<QuestionDto>()};
 }
Ejemplo n.º 2
0
        public void GetAllQuizes_ReturnedAllQuizes()
        {
            var quiz = new QuizDto { QuizId = 1, Name = "Name", Description = "Description" };
            IDbSet<QuizDto> quizes = new FakeDbSet<QuizDto> { quiz };
            A.CallTo(() => _context.Quizes).Returns(quizes);

            var result = _quizRepository.GetAllQuizes().Result;

            Assert.NotNull(result);
            Assert.True(result.Count() == 1);
            Assert.True(result.Any(x => x.QuizId == quiz.QuizId && x.Name == quiz.Name && x.Description == quiz.Description));
        }