Add a live template for Test.start/stopTest() with a braced block between

Issue #1088 resolved
Scott Wells repo owner created an issue

I think this is something that quite a few people would appreciate....a new Apex live template, tst, that results in the following:

Test.startTest();
{
    <cursor-lands-here>
}
Test.stopTest();

Even thought the added scope is artificial, it does two things: 1) it visually distinguishes the system-under-test logic via indentation; 2) it provides a new semantic scope for the system-under-test logic. The only real down-side is that if you want access to any variable assigned in that block, you would need to have been declared it before the block.

This should also work as for surround with behavior.

Comments (2)

  1. Log in to comment