Example #1
0
        public void PostFormbuilder_Title()
        {
            JObject obj = FormParser.PostFormbuilder(_form);

            var formBody = obj["form"];

            var formTitle = formBody["title"].ToString();;

            Assert.AreEqual(_form.Title, formTitle);
        }
Example #2
0
        public void FormParser_PostFormbuilder_DiscursiveQuestion()
        {
            JObject obj = FormParser.PostFormbuilder(_form);

            var formBody            = obj["form"];
            var discursiveQuestions = formBody["discussive"].ToObject <List <JObject> >();

            var question = discursiveQuestions[0]["question"].ToString();

            Assert.AreEqual(_form.DiscursiveQuestionsTitles[0], question);
        }
Example #3
0
        public void PostFormbuilder_Options()
        {
            JObject obj = FormParser.PostFormbuilder(_form);

            var formBody = obj["form"];

            List <List <string> > questionList = new List <List <string> >();


            var questions = formBody["multipleChoices"].ToObject <List <JObject> >();

            questionList.Add(questions[0]["options"].ToObject <List <string> >());
            questionList.Add(questions[1]["options"].ToObject <List <string> >());

            Assert.AreEqual(_question1.Options, questionList[0]);
            Assert.AreEqual(_question2.Options, questionList[1]);
        }
Example #4
0
        public void PostFormbuilder_MultipleAnwsers()
        {
            JObject obj = FormParser.PostFormbuilder(_form);

            var formBody = obj["form"];

            List <bool> multipleAnswersList = new List <bool>();


            var questions = formBody["multipleChoices"].ToObject <List <JObject> >();

            multipleAnswersList.Add(questions[0]["multiple_anwsers"].ToObject <bool>());
            multipleAnswersList.Add(questions[1]["multiple_anwsers"].ToObject <bool>());

            Assert.AreEqual(_question1.MultipleAnswers, multipleAnswersList[0]);
            Assert.AreEqual(_question2.MultipleAnswers, multipleAnswersList[1]);
        }