public async Task TestController_GetSurveyBySurveyId() { using (YuYanDBContext db = new YuYanDBContext()) using (YuYanDBRepository repos = new YuYanDBRepository(db)) { YuYanService svc = new YuYanService(repos); var controller = new SurveyController(svc); var result = await controller.GetSurveyBySurveyId(92); Assert.IsNotNull(result); } }
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); } }
public async Task TestController_CreateSurvey() { using (YuYanDBContext db = new YuYanDBContext()) using (YuYanDBRepository repos = new YuYanDBRepository(db)) { YuYanService svc = new YuYanService(repos); var controller = new SurveyController(svc); dtoSurvey testObj = new dtoSurvey(); testObj.Title = "Make me happy"; testObj.ShortDesc = "No short description"; var result = await controller.CreateSurvey(testObj); Assert.IsNotNull(result); } }