Question: Create a test file for Contact containing structural tests using the @Test annotation from JUnit. a . Create a setUpClass ( ) method with the

Create a test file for Contact containing structural tests using the @Test annotation from JUnit.
a. Create a setUpClass() method with the @BeforeAll annotation that initializes a static testObj member of your test class.
b. Use this testObj when writing tests for toString(), equals(), hashCode() and the four setter methods.
c. Finally create a provider called contactProvider() that generates an Arbitrary object.
6. Create a test file for AddressBook that has property-based test methods.
a. Create testAdd(), testRemove() and testFind()using the @Property annotation. Each should execute 1000 times and accept a provider listOfContacts. Each method should create a FakeDBO object and use it to create an AddressBook to test.
b. For testAdd() loop through the passed in List of Contacts and perform the following:
i. Get the list of matches for the contact in the AddressBook using find().
ii. Add the Contact to the AddressBook.
iii. Confirm that the AddressBook find() result is now one more than it was before the add.
c. For testRemove() loop through the passed in List of Contacts and add them to the AddressBook. Then loop again perform the following:
i. Get the list of matches for the contact in the AddressBook using find().
ii. Remove the Contact from the AddressBook.

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!