예제 #1
0
        public void GetLatestIdTest()
        {
            var request = new List <GrowthMindsetQuizAttempts>();

            _mokgrowthMindsetAttempt.Setup(a => a.GetLatestId(It.IsAny <string>(), It.IsAny <SortDefinition <GrowthMindsetQuizAttempts> >()));

            _growthMindsetAdapter = new GrowthMindsetAdapter(_mokgrowthMindsetQuiz.Object, _mokgrowthMindsetAttempt.Object, _settings.Object);

            var result = _growthMindsetAdapter.GetLatestId();

            _mokgrowthMindsetAttempt.Setup(a => a.GetLatestId(It.IsAny <string>(), It.IsAny <SortDefinition <GrowthMindsetQuizAttempts> >()));
        }
예제 #2
0
        public void InsertGrowthMindsetQuizTest()
        {
            var request = new GrowthMindsetQuiz();

            _mokgrowthMindsetQuiz.Setup(a => a.InsertOne(It.IsAny <GrowthMindsetQuiz>(), It.IsAny <string>()));

            _growthMindsetAdapter = new GrowthMindsetAdapter(_mokgrowthMindsetQuiz.Object, _mokgrowthMindsetAttempt.Object, _settings.Object);

            var result = _growthMindsetAdapter.InsertGrowthMindsetQuiz(request);

            _mokgrowthMindsetQuiz.Verify(a => a.InsertOne(It.IsAny <GrowthMindsetQuiz>(), It.IsAny <string>()));
        }
예제 #3
0
        public void InsertGrowthMindsetQuizAttemptsTest()
        {
            var request = new List <GrowthMindsetQuizAttempts>();

            _mokgrowthMindsetAttempt.Setup(a => a.InsertAll(It.IsAny <List <GrowthMindsetQuizAttempts> >(), It.IsAny <string>()));

            _growthMindsetAdapter = new GrowthMindsetAdapter(_mokgrowthMindsetQuiz.Object, _mokgrowthMindsetAttempt.Object, _settings.Object);

            var result = _growthMindsetAdapter.InsertGrowthMindsetQuizAttempts(request);

            _mokgrowthMindsetAttempt.Setup(a => a.InsertAll(It.IsAny <List <GrowthMindsetQuizAttempts> >(), It.IsAny <string>()));
        }
예제 #4
0
        public void GetGrowthMindsetQuizTest()
        {
            var response = new List <BsonDocument>
            {
                new BsonDocument {
                }
            };

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

            _growthMindsetAdapter = new GrowthMindsetAdapter(_mokgrowthMindsetQuiz.Object, _mokgrowthMindsetAttempt.Object, _settings.Object);

            var result = _growthMindsetAdapter.GetGrowthMindsetQuiz();

            Assert.IsInstanceOf <List <GrowthMindsetQuiz> >(result);
        }
예제 #5
0
        public void GetLatestAttemptByUserTest()
        {
            var response = new List <GrowthMindsetQuizAttempts>
            {
                new GrowthMindsetQuizAttempts {
                    attemptcount = 1
                }
            };

            _mokgrowthMindsetAttempt.Setup(a => a.GetData(It.IsAny <FilterDefinition <GrowthMindsetQuizAttempts> >(), It.IsAny <string>()));

            _growthMindsetAdapter = new GrowthMindsetAdapter(_mokgrowthMindsetQuiz.Object, _mokgrowthMindsetAttempt.Object, _settings.Object);

            var result = _growthMindsetAdapter.GetLatestAttemptByUser("");

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