public void GetQuestionsFromQuestionnaireShouldReturnListOfQuestions(int questionnaireId) { var expected = _dbMock.Object.Questions .Where(q => q.Questionnaire.Id == questionnaireId) .ToList(); var actual = _questionnaireService.GetQuestionsFromQuestionnaire(questionnaireId); Assert.Equal(expected, actual); }
private void GenerateReport() { Questionnaire questionnaire = SelectedFestival.Questionnaires.FirstOrDefault(); List <Question> questions = _questionnaireService.GetQuestionsFromQuestionnaire(questionnaire.Id); Controls = new ObservableCollection <FrameworkElement>(); CreateReport(); Controls.Add(CreateLabel("Beschrijving / Introductie")); Controls.Add(new TextBox { Height = 150, Width = 700, Margin = new Thickness(10), AcceptsReturn = true, AcceptsTab = true, TextWrapping = TextWrapping.Wrap }); Controls.Add(CreateLabel("Advies")); Controls.Add(new TextBox { Height = 150, Width = 700, Margin = new Thickness(10), AcceptsReturn = true, AcceptsTab = true, TextWrapping = TextWrapping.Wrap }); Controls.Add(CreateLabel("Vragen")); foreach (Question question in questions) { AddQuestionToReport(question); } }