コード例 #1
0
        public void SetUp()
        {
            ExpectedSurveyAdress       = new SurveyAdress(123, 7, "rue de Rivoli", "75000", "Paris");
            ExpectedSurveyLocationList = new List <ISurveyLocations>
            {
                new SurveyLocations(100, ExpectedSurveyAdress, CompletionStatus.TODO)
            };
            ExpectedSurveyQuestionList = new List <ISurveyQuestion>
            {
                new SurveyQuestion {
                    Id = 1, Question = "Q1"
                },
                new SurveyQuestion {
                    Id = 2, Question = "Q2"
                },
            };
            ExpectedSurvey = new Survey(175, "AnswerToAskOptionalQuestion", "AnswerToAskQuestion",
                                        ExpectedSurveyAdress, ExpectedSurveyQuestionList);

            questionHelper = Substitute.For <IQuestionHelper>();
            questionHelper.AskQuestion(Arg.Any <string>()).Returns("AnswerToAskQuestion");
            questionHelper.AskOptionalQuestion(Arg.Any <string>()).Returns("AnswerToAskOptionalQuestion");
            questionHelper.AskYesNoQuestion(Arg.Any <string>()).Returns(true);

            surveyLocationGetter = Substitute.For <ISurveyLocationGetter>();
            surveyLocationGetter.GetSurveyLocation().Returns(ExpectedSurveyLocationList);

            surveyQuestionGetter = Substitute.For <ISurveyQuestionGetter>();
            surveyQuestionGetter.GetSurveyQuestion().Returns(ExpectedSurvey);

            surveyCampaignMaker = new SurveyCampaignMaker(questionHelper, surveyLocationGetter, surveyQuestionGetter);
        }
コード例 #2
0
 public SurveyCampaignMaker(IQuestionHelper questionHelper,
                            ISurveyLocationGetter surveyLocationGetter,
                            ISurveyQuestionGetter surveyQuestionGetter)
 {
     _questionHelper       = questionHelper;
     _surveyLocationGetter = surveyLocationGetter;
     _surveyQuestionGetter = surveyQuestionGetter;
 }
コード例 #3
0
        public void SetUp()
        {
            expectedClientAdress = new SurveyAdress(123, 7, "rue de Rivoli", "75000", "Paris");

            questionHelper.AskQuestion(Arg.Any <string>()).Returns("AnswerToAskQuestion");
            questionHelper.AskOptionalQuestion(Arg.Any <string>()).Returns("AnswerToAskOptionalQuestion");
            questionHelper.AskYesNoQuestion(Arg.Any <string>()).Returns(false);

            surveyAdressGetter.GetSurveyAdress(Arg.Any <int>(), true).Returns(expectedClientAdress);

            surveyQuestionGetter = new SurveyQuestionGetter(questionHelper, surveyAdressGetter);
        }