Question
public class GalleryTest { //Review the test function below @Test void testFindPhotoWithSize() { //Generate data using the provided createGallery1() function Gallery gallery = Gallery. createGallery1
public class GalleryTest {
//Review the test function below
@Test
void testFindPhotoWithSize() {
//Generate data using the provided createGallery1() function
Gallery gallery = Gallery.createGallery1();
//gallery now contains 12 photos and 6 photographers
Photo result = gallery.findPhotoWithSize(581);
assertNotNull(result);
assertEquals(gallery.photos[0], result); //The 1st Photo object has a size of 581
assertEquals(gallery.photos[11], gallery.findPhotoWithSize(5613)); //The 11th Photo object has a size of 5613
assertEquals(null, gallery.findPhotoWithSize(6112)); //No photo objects have a size of 6112
}
//==================================
//== Place your tests below here! ==
//==================================
//TODO To be completed
// Test for photosLargerThen
// Test for findLastPhotoContaining
// Test for findPhotosContaining
//==================================
//== Do not edit the below tests! ==
//==================================
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started