public void AddQuestionAddsQuestionToList() { var survey = new Survey(); Guid questionId; var question = new SurveyQuestion { Question = "How Manny times do you go to the toilet in a day?" }; questionId = question.QuestionId; question.AddAnswer(new SurveyAlternative("Never")); question.AddAnswer(new SurveyAlternative("Once")); question.AddAnswer(new SurveyAlternative("2 - 4")); question.AddAnswer(new SurveyAlternative("5 or more")); survey.AddQuestion(question); Assert.IsTrue(survey.Questions.Exists(surveyQuestion => surveyQuestion.QuestionId == questionId)); }
public DisplaySurveyViewModel() { var survey = new Survey { #region Survey settup Title = "Undersøkelse om folks do vaner", Description = "Dette er en test undersøkelse om folks do vaner", }; var question = new SurveyQuestion { Question = "How Manny times do you go to the toilet in a day?" }; question.AddAnswer(new SurveyAlternative("Never")); question.AddAnswer(new SurveyAlternative("Once")); question.AddAnswer(new SurveyAlternative("2 - 4")); question.AddAnswer(new SurveyAlternative("5 or more")); survey.AddQuestion(question); question = new SurveyQuestion { Question = "How Manny times do you use others toilet in a week?" }; question.AddAnswer(new SurveyAlternative("Never")); question.AddAnswer(new SurveyAlternative("Once")); question.AddAnswer(new SurveyAlternative("2 - 4")); question.AddAnswer(new SurveyAlternative("5 or more")); survey.AddQuestion(question); question = new SurveyQuestion { Question = "How Manny times do you wach toilet in a month?" }; question.AddAnswer(new SurveyAlternative("Never")); question.AddAnswer(new SurveyAlternative("Once")); question.AddAnswer(new SurveyAlternative("2 - 4")); question.AddAnswer(new SurveyAlternative("5 or more")); survey.AddQuestion(question); #endregion SetupSurvey(survey); NextQuestionCommand = new DelegateCommand(NextQuestionAction); PreviousQuestionCommand = new DelegateCommand(PreviousQuestionAction); }