Answered step by step
Verified Expert Solution
Question
1 Approved Answer
package junit _ testing _ Jtorres 1 2 6 3 import static org.junit.Assert. public class ProductTest l etest public void testpriceVar ( ) { Product
package junittestingJtorres
import static org.junit.Assert.
public class ProductTest
etest
public void testpriceVar
Product prod new Product Dr Pepper", ;
double expected ;
double actual a prod.getprodprices
assertequalsexpected actual, ;
@test
public void testpriceVarForLessThanZero
Product prod new Product Dr Pepper", ;
double expected ;
double actual prodogetprodprice private :cdots is prodivames
private double prodprice;
private int prodQtys
public ProductString prodName, double prodprice constructor
this.prodName e prodName;
this.prodPrice o prodPrices
public product f no angs constructor
public static void mainString args
Product new Product;
psetprodPrice ;
System,out.printinpgetProdPrice;
public String getProdName
return prodName;
public void setProdNameString prodName
this. prodName prodNames
public double getProdPrice
return prodprices
public void setProdPricedouble prodPrice
if prodPrice o
this oprodprice
else
this oprodprice prodprices
public int getprodety
return prodetys
pubitic void setprodety int prodety f
this prodQty prodQtys
public string tostring f
return thisgetprodlame "this. getProdPrice;
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