Example #1
0
        public async Task TestController_CreateQuestion() { 
            using(YuYanDBContext db = new YuYanDBContext())
            using (YuYanDBRepository repos = new YuYanDBRepository(db)) {
                YuYanService svc = new YuYanService(repos);
                var controller = new SurveyController(svc);

                dtoSurveyQuestion questionObj = new dtoSurveyQuestion();
                questionObj.Question = "Add from Test";
                questionObj.QuestionType = QuestionType.checkbox;
                //questionObj.SurveyId = 6;

                var result = await controller.CreateQuestion(6, questionObj);
                Assert.IsNotNull(result);
            }
        }