/** * testGetCollection - this test method will be used to test the getCollection method in the * AudioList class. */ public void testGetCollection() { // Test One myCollection.add(af1); assertEquals(myCollection.getCollection(1), af1); // Test Two myCollection.add(af2); assertEquals(myCollection.getCollection(2), af2); // Test Three myCollection.add(af3); assertEquals(myCollection.getCollection(3), af3); // Test Four myCollection.add(af4); assertEquals(myCollection.getCollection(4), af4); // Test Five myCollection.add(af5); assertEquals(myCollection.getCollection(5), af5); // Test Six myCollection.add(af6); assertEquals(af6, myCollection.getCollection(6)); } // end testGetCollection method
/** testAdd - tests the the add method in the Audio */ public void testAdd() { // Test One myCollection.add(af1); assertEquals(myCollection.getCollection(1), af1); // Test Two myCollection.add(af2); assertEquals(myCollection.getCollection(2), af2); // Test Three myCollection.add(af3); assertEquals(myCollection.getCollection(3), af3); // Test Four myCollection.add(af4); assertEquals(myCollection.getCollection(4), af4); // Test Five myCollection.add(af5); assertEquals(myCollection.getCollection(5), af5); // Test Six myCollection.add(af6); assertEquals(myCollection.getCollection(6), af6); // Test Seven myCollection.add(af7); assertEquals(myCollection.getCollection(7), af7); // Test Eight myCollection.add(af8); assertEquals(myCollection.getCollection(8), af8); // Test Nine myCollection.add(af9); assertEquals(myCollection.getCollection(9), af9); // Test Ten myCollection.add(af10); assertEquals(myCollection.getCollection(10), af10); // Test Eleven myCollection.add(af11); assertEquals(myCollection.getCollection(11), af11); // Test Twelve myCollection.add(af12); assertEquals(myCollection.getCollection(12), af12); // Test Thirteen myCollection.add(af13); assertEquals(myCollection.getCollection(13), af13); // Test Fourteen myCollection.add(af14); assertEquals(myCollection.getCollection(14), af14); // Test Fifteen myCollection.add(af15); assertEquals(myCollection.getCollection(15), af15); // Test Sixteen myCollection.add(af16); assertEquals(myCollection.getCollection(16), af16); // Test Seventeen myCollection.add(af17); assertEquals(myCollection.getCollection(17), af17); } // end test add
/** testDelete - is used to test the delete method in the AudioList class */ public void testDelete() { myCollection.delete(); assertEquals(myCollection.getCollection(6), null); } // end testDelete method