Exemplo n.º 1
0
        public RepoCheck()
        {
            jm  = new JSONManager();
            tb  = new OrientTokenBuilder();
            tc  = new TypeConverter();
            ocb = new OrientCommandBuilder();
            wm  = new WebManager();
            wr  = new WebResponseReader();

            repo = new OrientRepo(jm, tb, tc, ocb, wm, wr);

            s = new SubUnit();

            p =
                new Person()
            {
                Name = "0", GUID = "0", Changed = new DateTime(2017, 01, 01, 00, 00, 00), Created = new DateTime(2017, 01, 01, 00, 00, 00)
            };

            u =
                new Unit()
            {
                Name = "0", GUID = "0", Changed = new DateTime(2017, 01, 01, 00, 00, 00), Created = new DateTime(2017, 01, 01, 00, 00, 00)
            };

            m =
                new MainAssignment()
            {
                Name = "0", GUID = "0", Changed = new DateTime(2017, 01, 01, 00, 00, 00), Created = new DateTime(2017, 01, 01, 00, 00, 00)
            };

            lp = new List <string>();
            lu = new List <string>();
        }
Exemplo n.º 2
0
        public static void QuizNewCheck()
        {
            OrientRepo repo = DefaultManagerInit();

            Quizes.QuizNewUOW quizUOW = new Quizes.QuizNewUOW(repo);

            quizUOW.InitClasses();

            List <QuizNewGet> qzReceive = new List <QuizNewGet>();
            List <QuizNewGet> qzSend    = new List <QuizNewGet>()
            {
                new QuizNewGet()
                {
                    key       = 0, value = "quiz 1", dateFrom = DateTime.Now, dateTo = DateTime.Now,
                    questions = new List <Question>()
                    {
                        new Question()
                        {
                            key = 0, value = "quiestion 1", toStore = true, type = "checkbox", answers = new List <Answer>()
                            {
                                new Answer()
                                {
                                    key = 0, value = "answer 1"
                                }
                                , new Answer()
                                {
                                    key = 1, value = "answer 2"
                                }
                            }
                        }

                        , new Question()
                        {
                            key = 0, value = "quiestion 2", toStore = true, type = "checkbox", answers = new List <Answer>()
                            {
                                new Answer()
                                {
                                    key = 0, value = "answer 1"
                                }
                                , new Answer()
                                {
                                    key = 1, value = "answer 2"
                                }
                                , new Answer()
                                {
                                    key = 2, value = "answer 3"
                                }
                            }
                        }
                    }
                }
                , new QuizNewGet()
                {
                    key       = 0, value = "quiz 2", dateFrom = DateTime.Now, dateTo = DateTime.Now,
                    questions = new List <Question>()
                    {
                        new Question()
                        {
                            key = 0, value = "quiestion 1", toStore = true, type = "text"
                        }

                        , new Question()
                        {
                            key = 0, value = "quiestion 2", toStore = true, type = "checkbox", answers = new List <Answer>()
                            {
                                new Answer()
                                {
                                    key = 0, value = "answer 1"
                                }
                                , new Answer()
                                {
                                    key = 1, value = "answer 2"
                                }
                                , new Answer()
                                {
                                    key = 2, value = "answer 3"
                                }
                            }
                        }
                    }
                }
            };

            string snd = jm.SerializeObject(qzSend);

            quizUOW.QuizPost(qzSend);

            qzReceive = quizUOW.QuizGet().ToList();

            quizUOW.QuizDelete(qzReceive);
        }