Nuridalia.Hernandez 48c7709b96 test 100% coverage done před 6 roky
src test 100% coverage done před 6 roky
.gitignore convert to intellij před 6 roky
pom.xml convert to intellij před 6 roky
readme.md updated read me and added requirement před 6 roky
requirement.md updated read me and added requirement před 6 roky

readme.md

Clean Code

Objective:

  • To learn to read code and write test for the Inventory class
  • To refactor (aka clean up) the code in the Inventory class to make it more maintainable and readable

Purpose:

  • To understand why writing readable code matter

Instructions:

  1. Fork this Repository
    • fork this repository to your personal github account
    • clone your forked repository to your local machine.
    • clean up the code in the Inventory class
    • commit your changes
    • submit a pull request which compares Zipcoder master to your master.
  2. DO NOT CHANGE THE ITEM CLASS

See test coverage

  1. Right click on the java folder in the test directory
  2. Select Run all with test coverage
  3. Note a window pop up which display which line is covered

Part 1 - Add tests

Add test and make sure the line of code coverage is 100%.

DO NOT alter the Item or Inventory class.

Here are the requirements for the shop. Link This is optional reading, but it will help you create your tests.

Part 2 - Refactor the code

Note how hard it is to read this code. Your task is to refactor the code to make it more readable. First create a new branch called refactor.

Part 3 - Add a new item

We have recently signed a supplier of conjured items. This requires an update to our system. First create a new branch called new-item. Add a conjured item.

  • "Conjured" items degrade in Quality twice as fast as normal items

Feel free to make any changes to the UpdateQuality method and add any new code as long as everything still works correctly.

This originated from Bobby Johnson's Blog.