Beispiel #1
0
        public void Create_Survey_Successfuly()
        {
            SurveyService service = new SurveyService(CreateStubRepository());
            Survey        survay  = service.Create(new SurveyDto(1, 1, 4, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 4, 3, 3, 2, 2, 5));

            survay.ShouldNotBeNull();
        }
Beispiel #2
0
 public IActionResult Create(SurveyDto surveyDto)
 {
     if (SurveyService.Create(surveyDto) == null)
     {
         return(BadRequest());
     }
     return(Ok());
 }
    private static Survey CreateSurvey()
    {
        SurveyService surveyService = new SurveyService();
        Survey        survey        = CreateNewSurvey();

        surveyService.Create(ref survey);

        return(survey);
    }
Beispiel #4
0
        public ActionResult Index(ViewObjects.Survey.Index model)
        {
            var baseObject = GetBaseObject();

            Guid[] surveyOptions = Request.Form.AllKeys.Where(x => x.StartsWith("SurveyOptions_")).Select(x => Guid.Parse(Request.Form[x])).ToArray();

            _surveyService.Create(model.Patient.Id, baseObject.User.Id, surveyOptions);

            return(RedirectToAction("Edit", "Patient", new
            {
                patientId = model.Patient.Id
            }));
        }
        public ActionResult <Survey> Create(Survey survey)
        {
            _surveyService.Create(survey);

            return(CreatedAtRoute("GetSurvey", new { id = survey.Id.ToString() }, survey));
        }