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); } }