And thougt I would make a brewing beer kata to the talk, though I'm not sure the following kata is good enough as a standard Kata, please give comment to improvements. Ill promise to post the final Kata in TypeScript later :-)
First draft of the kata:
- Create a simple Brewary with a method IBeer Brew()
- The method take 0 parameters but needs to return
an IBeer
- The Beer should be of type lager
- Allow the Brew method to handle a brewingTemperature and a fermentationInDays
argument
- If brewingTemperature is less than 5 throw
exception “Temperature is to low”
- If brewingTemperature is greater than 4 and
less than 11 return a beer of type lager
- If fermentationInDays is less than 7 and greater
than 14 throw exception “fermentation for lager beers should be between 7
and 14 days”
- Add optional
ingredients of type string as “roasted malt” and “barley” to make a stout
- If fermentationInDays less than 5 and greater
than 6 throw exception “fermentation for stouts beers should be 5 or 6
days”
- brewingTemperature not equal 20 throw
exception
- Expect
result to be of type Stout
- Expect
beers alcohol to be 7percent if fermentationInDays
is 5
- Expect
beers alcohol to be 8percent if fermentationInDays
is 6