posted 15 years ago
Creating exceptions and passing them to the controlling module (here method with scenarios). After an exception occurs your code should stop execution of current scenario and go to another one.
You could for example create MoviePropertiesNotSetException, IllegalAgeException, etc.
You need to have several scenarios resulting with different exceptions being thrown before finally executing a final scenario without exceptions being thrown.
My code is as below:
NOTE: Finally add another static method to the cinema class that demonstrates the usage of the cinema class. Include multiple scenarios to show how the exceptions work.