function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
developer srideveloper sri 

can anyone tell me test class structure for below class

can somebody help me writing Test class for below class:


public with sharing class classone {

 public static double getmethod1l( String param 1, 
       String param2, decimal param3){
        double method1Qty = 0;
       If ( param1.contains('32x2x33') && (param1.contains('pentium1') || 
         param1.contains('Core_')) && !param1.contains('AQ') && 
         !param1.contains('12W') && !param2.contains('LED')){
                method1Qty = param3;           
        return method1Qty;
   } // end of getmethod1     




Below code will help you:-


private class classone_Test {

    static testmethod void testclassone() {
		Double dGetU = classone.getmethod1l('32x2x33pentium1Core_', 'test', decimal.valueOf(10));



Hi developer sri,


In addition to what digamberlucky replied, here are a couple of links that will help you for future test classes: for VF page and controllers


Most important being the use of asserts, bulk testing for triggers as well as Test.StartTest()/Test.StopTest().