Question: Hi Please answer the following question ASAP. Write Unit tests as JUnit tests in the file BasketTesting.java file for the methods that are in the

Hi Please answer the following question ASAP.
Write Unit tests as JUnit tests in the file BasketTesting.java file for the methods that are in the given BasketTwelve.java, which implements the Basket.java file (interface).
The tests should test the methods written in the BasketTwelve.java implementation using sophisticated assertions that fail on the implementation. These sophisticated assertions will test all of the methods in BasketTwelve.java such that the test pass and fail in a way that is unique to the implementation.
Here are the Snapchat for the 4 given files:
1) Basket.java
 Hi Please answer the following question ASAP. Write Unit tests as
2) Item.java
JUnit tests in the file BasketTesting.java file for the methods that are
3) BasketTwelve.java
in the given BasketTwelve.java, which implements the Basket.java file (interface). The tests
should test the methods written in the BasketTwelve.java implementation using sophisticated assertions
4) BasketTesting.java
that fail on the implementation. These sophisticated assertions will test all of

Basket java 1 package student 3public interface Basket ereturn the total count of all itens, counting duplicates, in the basket int counto s eparam i The item to count ereturn The number of the provided item that are in the basket int countItem(Iten 1): 12 13 ereturn the total cost in cents of all items in the basket, count ing duplicates 15 int totatCost) 17 18 19 eparani The item to add void addToBasketItes t) 21 Remove a single copy of an item fron the basket 23 * eparani The Iten to renove ereturn false if the item was not in the basket, true otherwise 25 26 bootean removeFromBasket(Item i) Remove all copies of an item from the basket s eparam 1 The Iten to renove 29 ereturn false if the item was not in the basket, true otherwise 31 boolean removeALLFromBasket (item i): Remove all items from the basket 35 void esptyD 37 tem.java 1 package student; 3 public class Iten String nane; int priceInCents; public Iten(String name, int priceInCents) this nane nane: this priceInCents-priceInCents: 10 goverride public boolean equals(object other) TCCother instanceof Item)) return false: 14 Item i- (Item)other: return inate.equals(this.nate) .priceInCents-this.priceInCents; 19 BasketTwelve.java 1 package student 3 import java.util.ArrayList; 5 public class Basket12 inplements Basket t public Basket12) this.items new ArrayListeItem: this.counts new ArrayList BAGNUMS Arrays "asListine: Object[][] { {e), {1), (2), (3), (4), (5), {e), 15 16 17 private int bagType public BasketTest int bagType) 19 21 23 25 super); this bagType bagType; earameterized . Parameters(name "Basket(index)") public static Collectioncobjectll> bags) ( return BAGNUMS; private Basket makeBasket) switch(this.bagType) 29 case 0: return new Baskete); case 1: return new Basket10: case 2: return new Basket20: case 3: return new Basket30; case 4: return new Basket40: case 5: return new Basket5); case 6: return new Basket6); case 7: return new Basket70 case 8: return new Basket8); case 9: return new Basket9); case 18: return new Basket180: case 11: return new Basket110: case 12: return new Basket120: 35 36 38 41 return nutl: Basket java 1 package student 3public interface Basket ereturn the total count of all itens, counting duplicates, in the basket int counto s eparam i The item to count ereturn The number of the provided item that are in the basket int countItem(Iten 1): 12 13 ereturn the total cost in cents of all items in the basket, count ing duplicates 15 int totatCost) 17 18 19 eparani The item to add void addToBasketItes t) 21 Remove a single copy of an item fron the basket 23 * eparani The Iten to renove ereturn false if the item was not in the basket, true otherwise 25 26 bootean removeFromBasket(Item i) Remove all copies of an item from the basket s eparam 1 The Iten to renove 29 ereturn false if the item was not in the basket, true otherwise 31 boolean removeALLFromBasket (item i): Remove all items from the basket 35 void esptyD 37 tem.java 1 package student; 3 public class Iten String nane; int priceInCents; public Iten(String name, int priceInCents) this nane nane: this priceInCents-priceInCents: 10 goverride public boolean equals(object other) TCCother instanceof Item)) return false: 14 Item i- (Item)other: return inate.equals(this.nate) .priceInCents-this.priceInCents; 19 BasketTwelve.java 1 package student 3 import java.util.ArrayList; 5 public class Basket12 inplements Basket t public Basket12) this.items new ArrayListeItem: this.counts new ArrayList BAGNUMS Arrays "asListine: Object[][] { {e), {1), (2), (3), (4), (5), {e), 15 16 17 private int bagType public BasketTest int bagType) 19 21 23 25 super); this bagType bagType; earameterized . Parameters(name "Basket(index)") public static Collectioncobjectll> bags) ( return BAGNUMS; private Basket makeBasket) switch(this.bagType) 29 case 0: return new Baskete); case 1: return new Basket10: case 2: return new Basket20: case 3: return new Basket30; case 4: return new Basket40: case 5: return new Basket5); case 6: return new Basket6); case 7: return new Basket70 case 8: return new Basket8); case 9: return new Basket9); case 18: return new Basket180: case 11: return new Basket110: case 12: return new Basket120: 35 36 38 41 return nutl

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!