Question: You are expected to write JUnit Unit Tests for your homework assignments. While you are encouraged to use TDD , you are not required to

You are expected to write JUnit Unit Tests for your homework assignments. While you are encouraged to use TDD, you are not required to. You may use "test last coding" instead. However, you are expected to have tests for any code that is outside of a main method.
Begin by copying the classes from your activities package into your homework package. You will be using the interfaces and classes that you wrote during class to complete this homework.
Yes, the Pokmon are back (but don't worry, they are simpler now). Write a class called Pokemon that has a name (e.g. "Pikachu") and a number (e.g.25).
a. Implement a constructor that takes both values as parameters.
b. Implement accessors for both values.
c. Implement a toString() that returns a string in the format "Name(number)", e.g. "Pikachu(25)".
d. Implement an equals(Object) method (two Pokmon are considered equal if they have the same number).
e. Implement a hashCode() method that returns the number. We won't be using this, but it's a good idea to get into the habit of overriding the hashCode() method any time your override equals(Object)(remember the equals and hashCode contract).
You are expected to write JUnit Unit Tests for

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!