Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help Black-Box Testing my StudentCollection class. I need the code for the test class to make sure everything passes. (Right clicking the file

I need help Black-Box Testing my StudentCollection class. I need the code for the test class to make sure everything passes. (Right clicking the file StudentCollectionTest in NetBeans and hitting "Test File" should show all Tests Passed. Code in Java.

package studentcollection;

//StudentCollectionTest

import java.util.Iterator; import java.util.NoSuchElementException;

import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test;

import static org.junit.Assert.*;

import student.Student; import studentspec.StudentSpec;

import studentcollection.StudentCollectionSpec.StudentCollectionException;

public class StudentCollectionTest { public StudentCollectionTest() { }

@BeforeClass public static void setUpClass() { }

@AfterClass public static void tearDownClass() { }

@Before public void setUp() { }

@After public void tearDown() { }

@Test public void testGetCapacity() { System.out.println("getCapacity"); studentcollection.StudentCollection instance = new studentcollection.StudentCollection(); int expResult = 0; int result = instance.getCapacity(); assertEquals(expResult, result); }

@Test public void testReset() { System.out.println("reset"); studentcollection.StudentCollection instance = new studentcollection.StudentCollection(); instance.reset(); }

@Test public void testIsFull() { System.out.println("isFull"); studentcollection.StudentCollection instance = new studentcollection.StudentCollection(); boolean expResult = false; boolean result = instance.isFull(); assertEquals(expResult, result);

}

@Test public void testIsEmpty() { System.out.println("isEmpty"); studentcollection.StudentCollection instance = new studentcollection.StudentCollection(); boolean expResult = false; boolean result = instance.isEmpty(); assertEquals(expResult, result); }

@Test public void testGetStudentCount() { System.out.println("getStudentCount"); studentcollection.StudentCollection instance = new studentcollection.StudentCollection(); int expResult = 0; int result = instance.getStudentCount(); assertEquals(expResult, result); }

@Test public void testGetSpacesRemaining() { System.out.println("getSpacesRemaining"); studentcollection.StudentCollection instance = new studentcollection.StudentCollection(); int expResult = 0; int result = instance.getSpacesRemaining(); assertEquals(expResult, result); }

@Test public void testAddStudent() { System.out.println("addStudent"); studentspec.StudentSpec aStudent = null; studentcollection.StudentCollection instance = new studentcollection.StudentCollection(); instance.addStudent(aStudent); }

@Test public void testRetrieveStudentBySID() { System.out.println("retrieveStudentBySID"); java.lang.String sidKey = ""; studentcollection.StudentCollection instance = new studentcollection.StudentCollection(); studentspec.StudentSpec expResult = null; studentspec.StudentSpec result = instance.retrieveStudentBySID(sidKey); assertEquals(expResult, result); }

@Test public void testRemoveStudentBySID() { System.out.println("removeStudentBySID"); java.lang.String sidKey = ""; studentcollection.StudentCollection instance = new studentcollection.StudentCollection(); studentspec.StudentSpec expResult = null; studentspec.StudentSpec result = instance.removeStudentBySID(sidKey); assertEquals(expResult, result); }

@Test public void testToString() { System.out.println("toString"); StudentCollectionSpec instance = StudentCollection.createStudentCollection(); String expResult = ""; String result = instance.toString(); assertEquals(expResult, result); }

@Test

public void testCreateIterator() { System.out.println("createIterator"); studentcollection.StudentCollection instance = new studentcollection.StudentCollection(); java.util.Iterator expResult = null; java.util.Iterator result = instance.createIterator(); assertEquals(expResult, result); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

=+d. Write at least five sentences or phrases for body copy.

Answered: 1 week ago

Question

=+b. Create a tagline.

Answered: 1 week ago