• GemMaddy
  • NEWBIE
  • 25 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

hi   everybody..can anyone help me to write test class and how to pass values to variable objstdwrap?? here i want to send null values..

 

public class stdcont

{

stdWrapper objstdWrap = stdResults.get(stn);

if( obstdjWrap != NULL )
{    

 

some code logic  here..

}

}

 

thanks in advance.

regards

rajmul

 

  • January 31, 2013
  • Like
  • 0

Hi,

 

I've a code where I search for the products. To write a independent test, I need to create product and its corresponding entries like pricebook, standard price etc. To create a standard price, I tried the following code

 

Pricebook2 standardPB = [select id from Pricebook2 where isStandard=true];

 

But as I don't have set the SeeAllData annotation to true, this return nothing. I can't create the same new as IsStandard is read-only field.

 

Can anybody advise me with an alternate approach, probably where I can set the annotation SeeAllData to method level only (where I'm creating the product)?

 

Regards

Manish

Hi,

 

I've a code where I search for the products. To write a independent test, I need to create product and its corresponding entries like pricebook, standard price etc. To create a standard price, I tried the following code

 

Pricebook2 standardPB = [select id from Pricebook2 where isStandard=true];

 

But as I don't have set the SeeAllData annotation to true, this return nothing. I can't create the same new as IsStandard is read-only field.

 

Can anybody advise me with an alternate approach, probably where I can set the annotation SeeAllData to method level only (where I'm creating the product)?

 

Regards

Manish

hi   everybody..can anyone help me to write test class and how to pass values to variable objstdwrap?? here i want to send null values..

 

public class stdcont

{

stdWrapper objstdWrap = stdResults.get(stn);

if( obstdjWrap != NULL )
{    

 

some code logic  here..

}

}

 

thanks in advance.

regards

rajmul

 

  • January 31, 2013
  • Like
  • 0