Activity Forums Salesforce® Discussions How to test a class that contains no method in salesforce?

  • Kumar

    Member
    January 5, 2017 at 8:39 am

    Hello Sushant,

    You can still test it, because classes that have no defined constructors still have a default constructor. So, your unit test would look like this:

    @isTest static void test() {
    testController c = new testController();
    System.assertNotEquals(null, c.mapName);
    }

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos