コード例 #1
0
 /**
  * @test
  * @depends I_can_get_race
  *
  * @param Race $race
  */
 public function I_can_get_base_property(Race $race)
 {
     $tables = new Tables();
     foreach ($this->getGenders() as $genderCode) {
         foreach ($this->getBasePropertyCodes() as $propertyCode) {
             $sameValueByGenericGetter = $race->getProperty($propertyCode, $genderCode, $tables);
             $sameValueByBasePropertyGenericGetter = $race->getBaseProperty($propertyCode, $genderCode, $tables);
             switch ($propertyCode) {
                 case PropertyCode::STRENGTH:
                     $value = $race->getStrength($genderCode, $tables);
                     break;
                 case PropertyCode::AGILITY:
                     $value = $race->getAgility($genderCode, $tables);
                     break;
                 case PropertyCode::KNACK:
                     $value = $race->getKnack($genderCode, $tables);
                     break;
                 case PropertyCode::WILL:
                     $value = $race->getWill($genderCode, $tables);
                     break;
                 case PropertyCode::INTELLIGENCE:
                     $value = $race->getIntelligence($genderCode, $tables);
                     break;
                 case PropertyCode::CHARISMA:
                     $value = $race->getCharisma($genderCode, $tables);
                     break;
                 default:
                     $value = null;
             }
             self::assertSame($this->getExpectedBaseProperty($genderCode->getValue(), $propertyCode), $value, "Unexpected {$genderCode} {$propertyCode}");
             self::assertSame($sameValueByGenericGetter, $value);
             self::assertSame($sameValueByBasePropertyGenericGetter, $value);
         }
     }
 }