Exemplo n.º 1
0
        private static string?GenerateAnswer(SurveyQuestion question)
        {
            switch (question.TypeOfQuestion)
            {
            case QuestionType.YesNo:
                return(rn.Next(0, 1) == 1 ? "yes": "no");

            case QuestionType.Number:
                var n = rn.Next(-30, 101);

                return(n < 0? default: n.ToString());

            default:
                switch (rn.Next(0, 5))
                {
                case 0: return(default);

                case 1: return("red");

                case 2: return("blue");

                case 3: return("green");

                default: return("idk man, colors are hard");
                }
            }
        }
Exemplo n.º 2
0
 public void AddQuestion(SurveyQuestion surveyQuestion) => surveyQuestions.Add(surveyQuestion);