Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions