ApexSensei

Drills Unit testing

Prove bulk behavior

Bulk tests use real batch sizes, like 200 records, and check every result.

Your task

Finish verify so it fails the test when any item, or the number of items, differs from what you expect.

@IsTest
public class AS_5B99BDC873CD_BulkTests {
    public static List<String> verify(List<String> inputs, List<String> expected) {
        List<String> actual = AS_5B99BDC873CD_NameService.normalize(inputs);
        return new List<String>();
    }

    @IsTest
    static void normalizesNames() {
        List<String> expected = new List<String>{ 'north', 'south' };
        Assert.areEqual(expected, verify(new List<String>{ '  NORTH ', 'South' }, expected));
    }
}

Requirements

  1. verifiesOrderedValues should pass
  2. verifiesNullAndEmpty should pass
  3. verifiesTwoHundredItems should pass
  4. catchesWrongMiddleValue should pass
  5. catchesMissingItem should pass
  6. catchesExtraItem should pass

Sign in to open this drill