Example #1
0
        public void GetProductivityZoneQuizAttemptsTest()
        {
            var response = new ProductivityZoneQuizAttempts
            {
                attemptcount = 1
            };
            var quizAttemptResponse = new List <BsonDocument>
            {
                new BsonDocument {
                }
            };
            var request      = new QuizDetails();
            var quizResponse = new List <ProductivityZoneQuiz>
            {
                new ProductivityZoneQuiz {
                    id = 1
                }
            };

            _mokproductivityZoneQuizAdapter.Setup(a => a.GetLatestAttemptByUser(It.IsAny <string>())).Returns(response);
            _mokquizAttempt.Setup(a => a.GetRecords(It.IsAny <string>(), It.IsAny <FilterDefinition <BsonDocument> >())).Returns(quizAttemptResponse);

            _mokproductivityZoneQuizAdapter.Setup(a => a.GetProductivityZoneQuizzes()).Returns(quizResponse);

            _reportsAdpater = new ReportsAdapter(_mokquizAttempt.Object, _settings.Object, _mokcuriousQuizAdapter.Object, _mokgrowthMindsetQuizAdapter.Object,
                                                 _mokmakingTimeForMeQuizAdapter.Object, _mokstoryTellingForImpactAdapter.Object, _mokblindSpotAdapter.Object, _moklearningMythAdapter.Object, _mokcontinuousLearningAdapter.Object,
                                                 _mokculturalObservationAdapter.Object, _mokproductivityZoneQuizAdapter.Object, _mokreflectionToolAdapter.Object);

            var result = _reportsAdpater.GetProductivityZoneQuizAttempts("", 2, request);

            Assert.IsInstanceOf <List <QuizAttempts> >(result);
        }
Example #2
0
        public void GetLatestIdTest()
        {
            var response = new ProductivityZoneQuizAttempts();

            _mokproductivityZoneQuizAttempt.Setup(a => a.GetLatestId(It.IsAny <string>(), It.IsAny <SortDefinition <ProductivityZoneQuizAttempts> >())).Returns(response);

            _productivityZoneQuizAdapter = new ProductivityZoneQuizAdapter(_mokproductivityZoneQuiz.Object, _mokproductivityZoneQuizAttempt.Object, _settings.Object);

            var result = _productivityZoneQuizAdapter.GetLatestId();

            Assert.IsInstanceOf <ProductivityZoneQuizAttempts> (result);
        }