Eclipse and JUnit Tutorial
- Open Eclipse
- Create a new Java project
- Create two source folders (src and test)
- Create a new class called House
- Add members squareFeet, askingPrice, bedrooms, bathrooms
- Generate getters/setters
- Add a method getPricePerSqFoot()
- Create a new test class called HouseTest
- Add a setUp() method
- Add a test for the getPricePerSqFoot method
- Run the test, debug, and fix
- Use the refactoring menu to change a method name
- Look at other refactoring options
- Look at other assert methods
Resources