/**
  * @param Questionnaire $questionnaire
  */
 protected function buildGreenDrinkingNarrative(Questionnaire $questionnaire)
 {
     switch (true) {
         case DrinkingBetween3And5DaysWithinSuggestedLimitsSpecification::isSatisfiedBy($questionnaire):
             $this->narrative->addMessages(self::SECTION_NAME, array('drinking_green_in_gender_limits'));
             break;
         case DrinkingIsLTMonthlyAndHasBingeSpecification::isSatisfiedBy($questionnaire):
             $this->narrative->addMessages(self::SECTION_NAME, array('drinking_green_lt_monthly_with_binge'));
             break;
         case DrinkingLessThanMonthlyAndDoesNotBingeSpecification::isSatisfiedBy($questionnaire):
             $this->narrative->addMessages(self::SECTION_NAME, array('drinking_green_lt_monthly_no_binge'));
             break;
         case Drinking2to4TimesAMonthWithBingeSpecification::isSatisfiedBy($questionnaire):
             $this->narrative->addMessages(self::SECTION_NAME, array('drinking_green_2_to_4_monthly_with_binge'));
             break;
         case Drinking2to4TimesAMonthNoBingeSpecification::isSatisfiedBy($questionnaire):
             $this->narrative->addMessages(self::SECTION_NAME, array('drinking_green_2_to_4_monthly_no_binge'));
             break;
         case DrinkingLTE2DaysLTE3UnitsSpecification::isSatisfiedBy($questionnaire):
             $this->narrative->addMessages(self::SECTION_NAME, array('drinking_green_lt_2_days'));
             break;
         default:
             $this->narrative->addMessages(self::SECTION_NAME, array('drinking_green_never'));
             break;
     }
 }
 public function testSpecificationIsTrue()
 {
     $questionnaire = new Questionnaire((new Person())->setGender(Person::GENDER_MALE));
     $drinks = $questionnaire->getDrinking()->getWeekdayDrinks()->setBeerCiderBottleAmount(2);
     $questionnaire->getDrinking()->setDoYouDrink(Drinking::DOES_DRINK)->setWhichDaysDoYouDrink('mon, tues, wed, thur')->setBingingFrequency(Drinking::BINGE_NEVER)->setWeekdayDrinks($drinks);
     $this->assertTrue(DrinkingBetween3And5DaysWithinSuggestedLimitsSpecification::isSatisfiedBy($questionnaire));
 }
 /**
  * @param Questionnaire $questionnaire
  * @return bool
  */
 protected function isGreenDueToLowerUnitsAndGoodSpreadOfDays(Questionnaire $questionnaire)
 {
     return DrinkingSpec\DrinkingBetween3And5DaysWithinSuggestedLimitsSpecification::isSatisfiedBy($questionnaire);
 }