Question: please solve this Part 3 - Coding Problems 20. (8 pts) You have the following test routine: package spring 2020. DogAndCat Interface: import statie org.unit.jupiter.api.Assertions.

 please solve this Part 3 - Coding Problems 20. (8 pts)

please solve this

Part 3 - Coding Problems 20. (8 pts) You have the following test routine: package spring 2020. DogAndCat Interface: import statie org.unit.jupiter.api.Assertions. import org.unit.jupiter.api. BeforeAll import org. junit.jupiter.api.BeforeEach; import org. junit.jupiter.api. Test; class Animal Test @BeforeAll static void setUpBeforeClass() throws Exception @Before Each void setup() throws Exception Test void test() { Dog Riker = new Dog ("Riker"); assertEquals (Riker.getName(), "Riker"); Cat Skippy = new Cat ("Skippy"); assertEquals (Skippy.getName(), "Skippy"); @Test void testArray() { Dog Riker = new Dog ("Riker"); Animal [] pets = {Riker, new Cat ("Skippy") }; StringBuilder sb = new StringBuilder (); for (Animal pet: pets) { sb.append(pet.getName()); assertEquals ("RikerSkippy", sb.toString(); Write Animal, Dog, and Cat classes. Try to put as much code as you can into Animal so that Dog and Cat have the least amount of code

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 Databases Questions!