File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ private class RepoFactoryMockTest {
1717 @IsTest
1818 static void addsMockCursor () {
1919 Account acc = new Account (Id = TestingUtils .generateId (Schema .Account .SObjectType ));
20- List < Account > accounts = new List < Account >{ acc } ;
20+ Account secondAccount = new Account ( Id = TestingUtils . generateId ( Schema . Account . SObjectType )) ;
2121 RepoFactoryMock .CursorResults .put (
2222 Account .SObjectType ,
23- new List <Cursor >{ new RepoFactoryMock .CursorMock (accounts ) }
23+ new List <Cursor >{ new RepoFactoryMock .CursorMock (new List < Account >{ acc , secondAccount } ) }
2424 );
2525
2626 RepoFactoryMock .FacadeMock facade = new RepoFactoryMock .FacadeMock ();
@@ -31,7 +31,9 @@ private class RepoFactoryMockTest {
3131 );
3232 Cursor cursor = repo .getCursor (new List <Query >());
3333
34- Assert .areEqual (1 , cursor .getNumRecords ());
34+ Assert .areEqual (2 , cursor .getNumRecords ());
3535 Assert .areEqual (acc .Id , cursor .fetch (0 , 1 )[0 ].Id );
36+ // verify we don't overindex past the actual cursor end
37+ Assert .areEqual (secondAccount .Id , cursor .fetch (1 , 3 )[0 ].Id );
3638 }
3739}
You can’t perform that action at this time.
0 commit comments