Esempio n. 1
0
        public void MakingTimeForMeQuizController_saveMakingTimeForMeQuiz()
        {
            //Act
            var actual = new MakingTimeForMeQuizController(_makingTimeForMeQuizBusinessLogic.Object);
            var makingTimeForMeQuiz = new MakingTimeForMeQuiz();

            var target = actual.saveMakingTimeForMeQuiz(makingTimeForMeQuiz);

            //Assert
            Assert.IsNotNull(target);
            Assert.AreEqual(200, ((ObjectResult)target).StatusCode);
        }
Esempio n. 2
0
        public void InsertMakingTimeForMeQuizTest()
        {
            var request = new MakingTimeForMeQuiz();

            _mokmakingTimeForMeQuiz.Setup(a => a.InsertOne(It.IsAny <MakingTimeForMeQuiz>(), It.IsAny <string>()));

            _makingTimeForMeQuizAdapter = new MakingTimeForMeQuizAdapter(_mokmakingTimeForMeQuiz.Object, _mokmakingTimeForMeQuizAttempt.Object, _settings.Object);

            var result = _makingTimeForMeQuizAdapter.InsertMakingTimeForMeQuiz(request);

            _mokmakingTimeForMeQuiz.Verify(a => a.InsertOne(It.IsAny <MakingTimeForMeQuiz>(), It.IsAny <string>()));
        }
Esempio n. 3
0
        public List <MakingTimeForMeQuiz> ReadMakingTimeQuiz(ExcelWorksheet worksheet, string action)
        {
            List <MakingTimeForMeQuiz> makingTimeQuizzes = new List <MakingTimeForMeQuiz>();
            var id = 1;

            for (var rowNumber = 2; rowNumber <= worksheet.Dimension.End.Row; rowNumber++)
            {
                var row = worksheet.Cells[rowNumber, 1, rowNumber, worksheet.Dimension.End.Column];
                MakingTimeForMeQuiz question = new MakingTimeForMeQuiz {
                    scores = new Score()
                };

                var columnNumber = 0;
                foreach (var cell in row)
                {
                    switch (columnNumber)
                    {
                    case 0:
                        question.question = cell.Text;
                        break;

                    case 1:
                        question.scores.always = Convert.ToInt32(cell.Text?.Trim());
                        break;

                    case 2:
                        question.scores.often = Convert.ToInt32(cell.Text?.Trim());
                        break;

                    case 3:
                        question.scores.sometimes = Convert.ToInt32(cell.Text?.Trim());
                        break;

                    case 4:
                        question.scores.rarely = Convert.ToInt32(cell.Text?.Trim());
                        break;

                    case 5:
                        question.scores.never = Convert.ToInt32(cell.Text?.Trim());
                        break;
                    }

                    columnNumber++;
                }

                question.id = id;
                question.updatetimestamp = DateTime.Now.ToString(CultureInfo.InvariantCulture);
                makingTimeQuizzes.Add(question);
                id++;
            }

            return(makingTimeQuizzes);
        }
        public void ReflectionToolController_SaveReflectionToolQuizAttempt()
        {
            //Act
            var actual = new ReflectionToolController(_reflectionToolBusinessLogics.Object);
            var makingTimeForMeQuiz = new MakingTimeForMeQuiz();
            List <ReflectionToolQuizAttempt> reflectionToolQuizAttempt = new List <ReflectionToolQuizAttempt>();

            {
            }
            actual.SaveReflectionToolQuizAttempt(reflectionToolQuizAttempt);

            //Assert
            Assert.IsNotNull(actual);
        }
Esempio n. 5
0
 public int InsertMakingTimeForMeQuiz(MakingTimeForMeQuiz makingTimeForMeQuiz)
 {
     _makingTimeForMeQuiz.InsertOne(makingTimeForMeQuiz, _makingTimeForMeQuizCollection);
     return(1);
 }
Esempio n. 6
0
 public int InsertMakingTimeForMeQuizzes(MakingTimeForMeQuiz makingTimeForMeQuiz)
 {
     return(_makingTimeForMeQuizAdapter.InsertMakingTimeForMeQuiz(makingTimeForMeQuiz));
 }
Esempio n. 7
0
 public IActionResult saveMakingTimeForMeQuiz([FromBody] MakingTimeForMeQuiz makingTimeForMeQuiz)
 {
     return(Ok(_makingTimeForMeQuizBusinessLogic.InsertMakingTimeForMeQuizzes(makingTimeForMeQuiz)));
 }