Beispiel #1
0
        public void InsertLearningMythQuizAttemptsTest()
        {
            var request = new List <LearningMythsQuizAttempts>();

            _moklearningMythQuizAttempt.Setup(a => a.InsertAll(It.IsAny <List <LearningMythsQuizAttempts> >(), It.IsAny <string>()));

            _learningMythAdapter = new LearningMythsAdapter(_moklearningMythQuiz.Object, _moklearningMythQuizAttempt.Object, _settings.Object);

            var result = _learningMythAdapter.InsertLearningMythQuizAttempts(request);

            _moklearningMythQuizAttempt.Verify(a => a.InsertAll(It.IsAny <List <LearningMythsQuizAttempts> >(), It.IsAny <string>()));
        }
Beispiel #2
0
        public void GetLatestIdTest()
        {
            var request = new List <LearningMythsQuizAttempts>();

            _moklearningMythQuizAttempt.Setup(a => a.GetLatestId(It.IsAny <string>(), It.IsAny <SortDefinition <LearningMythsQuizAttempts> >()));

            _learningMythAdapter = new LearningMythsAdapter(_moklearningMythQuiz.Object, _moklearningMythQuizAttempt.Object, _settings.Object);

            var result = _learningMythAdapter.GetLatestId();

            _moklearningMythQuizAttempt.Verify(a => a.GetLatestId(It.IsAny <string>(), It.IsAny <SortDefinition <LearningMythsQuizAttempts> >()));
        }
Beispiel #3
0
        public void GetLearningMythsQuizzesTest()
        {
            var response = new List <BsonDocument>
            {
                new BsonDocument {
                }
            };

            _moklearningMythQuiz.Setup(a => a.GetTotalRecords(It.IsAny <string>())).Returns(response);

            _learningMythAdapter = new LearningMythsAdapter(_moklearningMythQuiz.Object, _moklearningMythQuizAttempt.Object, _settings.Object);

            var result = _learningMythAdapter.GetLearningMythsQuizzes();

            Assert.IsInstanceOf <List <LearningMythsQuiz> >(result);
        }
Beispiel #4
0
        public void GetLatestAttemptByUserTest()
        {
            var response = new List <LearningMythsQuizAttempts>
            {
                new LearningMythsQuizAttempts {
                    attemptcount = 1
                }
            };

            _moklearningMythQuizAttempt.Setup(a => a.GetData(It.IsAny <FilterDefinition <LearningMythsQuizAttempts> >(), It.IsAny <string>()));

            _learningMythAdapter = new LearningMythsAdapter(_moklearningMythQuiz.Object, _moklearningMythQuizAttempt.Object, _settings.Object);

            var result = _learningMythAdapter.GetLatestAttemptByUser("");

            _moklearningMythQuizAttempt.Verify(a => a.GetData(It.IsAny <FilterDefinition <LearningMythsQuizAttempts> >(), It.IsAny <string>()));
        }