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

How to run a test class for series of controller classes
Hi All,
I've senario like this.
Have some series of winzard type service classes
Once page one submitted it goes to a page two, page two submitted then it goes to page 3. like wise it goes until wizard ends.
each page has submitNext (under that save()) and submitBack (Under that SaveBack()) to go to the Next page and Back page.
each save and saveback functions call a common class method to access database and consume 5-6 queries.
Is it possible me write a one test class and cover the test coverage of all the controllers, without exceeding SQL 101 limitation.
Please help me
Best regards.
I've senario like this.
Have some series of winzard type service classes
Once page one submitted it goes to a page two, page two submitted then it goes to page 3. like wise it goes until wizard ends.
each page has submitNext (under that save()) and submitBack (Under that SaveBack()) to go to the Next page and Back page.
each save and saveback functions call a common class method to access database and consume 5-6 queries.
Is it possible me write a one test class and cover the test coverage of all the controllers, without exceeding SQL 101 limitation.
Please help me
Best regards.
This class is a little silly but each step builds on the previous step. So testing step one of the controller is pretty easy because it's just populating the this.acct variable and then making sure it gets inserted correctly. But we don't want to have to run through step 1 and 2 to test step three. So we would fake it like in the test method below
In the test above our governor limits will read as 0 for SOQL and 1 for DML for the code ran between the start/stopTest and will be 0 for SOQL and 3 for DML outside the start/stopTest. If we did not fake the data (like the CustomField__c on the Contact) we would have a SOQL query. This example doesn't really show how you could save a bunch of SOQL/DML but it does scale.