Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Im confused on how to ttest for my bag size. The setup needs to be let intentionally blank. I am following the UML diagram but

Im confused on how to ttest for my bag size. The setup needs to be let intentionally blank. I am following the UML diagram but lost on what they mean by putting in a Display Collection Class inside of our testBagSize() method, how to implement the getCurrentSize() method for our Bag, and where to put in the assertTrue method.

UML Diagram:

image text in transcribed

Test your bags size

1.) In your testBagSize() method, you need to create an instance of the DisplayCollection class. You can callgetItemBag() to get a reference to your DisplayCollection's bag, and store that in a local variable.

2.) Now that we have our bag, we need to check that its size is between 5 and 15. Call the getCurrentSize() method of the Bag class to get its size, and test that this number is between 5 and 15. This means that size 5, and size 15, are legal, but sizes 4 and 16 are not.

3.) To test whether an Integer value like size is greater or less than some value, you can use the assertTrue(boolean condition) method. This method takes one parameter, and checks that it is true. To give this method a boolean parameter, you can use size

CODE

/** * */ package project1;

import student.TestCase; /** * @author User1 * */ public class DisplayCollectionTest extends TestCase { /** * Setup left intentionally blank */ public void setup() { } public void testBagContents() { } public void testBagSize() { DisplayCollection.newInstance(); { Error:Method NewInstance is undefined } public int getCurrentSize(); { Error: getCurrentSize is undefined for the Display Collection Test } }

}

> Display Collection Test project 1 DisplayCollection Test() setUp():void testBag Contents():void o testBag Size():void > Display Collection Test project 1 DisplayCollection Test() setUp():void testBag Contents():void o testBag Size():void

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

New Trends In Databases And Information Systems Adbis 2019 Short Papers Workshops Bbigap Qauca Sembdm Simpda M2p Madeisd And Doctoral Consortium Bled Slovenia September 8 11 2019 Proceedings

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Robert Wrembel ,Mirjana Ivanovic ,Johann Gamper ,Mikolaj Morzy ,Theodoros Tzouramanis ,Jerome Darmont

1st Edition

3030302776, 978-3030302771

More Books

Students also viewed these Databases questions

Question

Define procedural justice. How does that relate to unions?

Answered: 1 week ago