Question: package junit _ testing _ Jtorres 1 2 6 3 import static org.junit.Assert. public class ProductTest l etest public void testpriceVar ( ) { Product

package junit_testing_Jtorres1263
import static org.junit.Assert.
public class ProductTest l
etest
public void testpriceVar(){
Product prod = new Product ("Dr. Pepper", 1.25) ;
double expected =1.25;
double actual a prod.getprodprice()s
}
assertequals(expected, actual, 0);
@test
public void testpriceVarForLessThanZero(){
Product prod = new Product ("Dr. Pepper", -1.99) ;
double expected =0.25;
double actual = prodogetprodprice( private 8:cdots is prodivames
private double prodprice;
private int prodQtys
public Product(String prodName, double prodprice) constructor
}
this.prodName e prodName;
}
this.prodPrice o prodPrices
public product() f //no angs constructor
}
public static void main(String[] args){
Product pl= new Product();
p1.setprodPrice (-20);
}
System,out.printin(p1.getProdPrice());
public String getProdName(){
}
return prodName;
public void setProdName(String prodName){
}
this. prodName = prodNames
public double getProdPrice(){
}
return prodprices
public void setProdPrice(double prodPrice){
if (prodPrice o){
3
this oprodprice =0.25g
else {
}
this oprodprice = prodprices
}
public int getprodety(){
}
return prodetys
pubitic void setprodety (int prodety) f
}
this prodQty = prodQtys
public string tostring() f
}
return this-getprodlame()+", "this. getProdPrice();
 package junit_testing_Jtorres1263 import static org.junit.Assert. public class ProductTest l etest public

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!