Ejemplo n.º 1
0
        public void GetLatestAttemptByUserTest()
        {
            _mokproductivityZoneQuizAttempt.Setup(a => a.GetData(It.IsAny <FilterDefinition <ProductivityZoneQuizAttempts> >(), It.IsAny <string>()));

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

            var result = _productivityZoneQuizAdapter.GetLatestAttemptByUser("");

            _mokproductivityZoneQuizAttempt.Verify(a => a.GetData(It.IsAny <FilterDefinition <ProductivityZoneQuizAttempts> >(), It.IsAny <string>()));
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public void InsertProductivityZoneQuizTest()
        {
            var request = new ProductivityZoneQuiz();

            _mokproductivityZoneQuiz.Setup(a => a.InsertOne(It.IsAny <ProductivityZoneQuiz>(), It.IsAny <string>()));

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

            var result = _productivityZoneQuizAdapter.InsertProductivityZoneQuiz(request);

            _mokproductivityZoneQuiz.Verify(a => a.InsertOne(It.IsAny <ProductivityZoneQuiz>(), It.IsAny <string>()));
        }
Ejemplo n.º 4
0
        public void GetProductivityZoneQuizzesTest()
        {
            var response = new List <BsonDocument>
            {
                new BsonDocument {
                }
            };

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

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

            var result = _productivityZoneQuizAdapter.GetProductivityZoneQuizzes();

            Assert.IsInstanceOf <List <ProductivityZoneQuiz> >(result);
        }