ApexSensei

Drills Unit testing

Reset limits around the act

Test.startTest() gives the code under test a fresh set of governor limits.

Your task

Finish the helper so it counts only the queries the service runs, even when setup used the whole query limit.

@IsTest
public class AS_97398297DFBD_LimitTests {
    public static Integer measureFreshQueries(Integer count) {
        return null;
    }

    @IsTest
    static void measuresWork() {
        Assert.areEqual(2, measureFreshQueries(2));
    }
}

Requirements

  1. measuresZeroFreshQueries should pass
  2. measuresOneFreshQuery should pass
  3. measuresSevenFreshQueries should pass
  4. closesTheFreshWindow should pass
  5. returnsWhatLimitsReports should pass

Sign in to open this drill