Factory Basics

Elvenware Logo

TOC

#FactoryBasics

Open the Factory Simple project:

Study the BoatFactorySpec. Notice the unit tests for the Sloop class. In the same spec file, create similar unit tests for the Yawl and Ketch classes. Make sure there is a test showing that a Yawl has a mizzen and a Sloop has a keel. A Ketch should have a topsail.

Make sure you can create and test for the existence of:

And write the tests above, and also give each object a unique color and test for that color. That is make sure a yawl is red, a sloop is green and a ketch is blue. (Choose whatever colors you want.)

The main point is to show that you can create a Yawl, Sloop, and Ketch and run tests to show that they each have certain unique traits. You need to know how to do this in order to complete the more complex BridgePattern assignment.