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
iswarya sekar 7iswarya sekar 7 

My test Class.

@isTest
public class CaseClassTest {
    
    static TestMethod void MyUnitTest(){
        
        Test.startTest();
        Pagereference tocase = Page.NewVFPage;
        
        Case  testCase = new Case();
        
        testCase.Status='Closed';
        testCase.Reason='Other';
        
        insert testCase;
        
        Test.setCurrentPage(tocase);
        
        tocase.getParameters().put('Id',testCase.id);
        ApexPages.StandardController sc = new ApexPages.standardController(testCase);
        CaseClass  cas = new CaseClass (sc);
        
        test.stopTest();
        
        
    }
}

I'm not getting maximum code coverage.. Help me to sort out this
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Aishwarya Sekar, hope it helps.

Please mark it as best answer if the information is informative.

Thanks
Rahul Kumar
Amit Chaudhary 8Amit Chaudhary 8
Can you please share apex class for which you are creating test class ?