Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyReportService {
- DataSource source;
- public MyReportService(DataSource ds) {
- this.source = ds;
- }
- // Bunch of other methods that do things with with data source.
- }
- DataSource myMockDataSource = generateMyMockDataSourceSomehow();
- MyReportService service = new MyReportService(myMockDataSource);
- Test.startTest();
- Integer retVal = service.answerMagicalQuestion();
- Test.stopTest();
- System.assertEquals(42, retVal, 'magical answer wrong');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement