The following JUnit test method purports to test the add() method from BasicCollection. Assume the setUp() method from BasicCollectionTester is used. Are there problems?
```
public void testAdd() {
assertTrue( c.isEmpty() );
assertTrue ( c.contains(“B”) );
assertTrue ( c.contains(“C “) );
assertTrue ( c.contains(“A”) );
assertEquals( c.contains(“Missing”), false );
}
```
The first test will not pass because there are 3 elements in the collection from the setup() method in BasicCollectionTester. Therefore, the testAdd() method is not relevant to evaluate the correctness of add(). Removing the first assertTrue(), we will be able to use the testAdd() method as intended.
You might also like to view...
The ______ operation of the ADT stack adds an item to the top of the stack.
a. isEmpty b. push c. pop d. peek
The presentation tier of the three-tier structure consists of one or more forms and the objects placed on the forms.
Answer the following statement true (T) or false (F)