You need to sign in to do that
Don't have an account?

Test class Coverage ( Urgent)
Hi All,
How i need to cover my code coverage for below code in my class.
public class productDetail {
public list<string> productCode {get; set;}
public list<string> productDescription {get;set;}
public list<string> productName {get; set;}
public list<string> pricebookName {get; set;}
public list<string> pricebookId {get; set;}
public list<string> pricebookPrice {get; set;}
public productDetail (){
productCode = new list<string>();
productDescription = new list<string>();
productName = new list<string>();
pricebookName = new list<string>();
pricebookId = new list<string>();
pricebookPrice = new list<string>();
}
}
public class pricebookInfo {
public list<string> colNames {get; set;}
public list<string> colModel {get; set;}
public list<productDetail> products {get; set;}
}
Its pretty simple. As you have only Class denination and contrustor so you can instantiate your class in test method and you will be able to cover the code.
Like:
@isTest
private class ProductDetailsTest {
@isTest
static void myTest1() {
ProductDetail pDetail = new ProductDetail();
}
}
Give it a try.
All Answers
Its pretty simple. As you have only Class denination and contrustor so you can instantiate your class in test method and you will be able to cover the code.
Like:
@isTest
private class ProductDetailsTest {
@isTest
static void myTest1() {
ProductDetail pDetail = new ProductDetail();
}
}
Give it a try.
@IsTest
public static testMethod void testproductDetail ()
{
productDetail pd=new productDetail();
pd. productDetail ();
}