Created
January 19, 2021 19:12
-
-
Save surajp/9f55c453f0a21894875e032ebf61d22e to your computer and use it in GitHub Desktop.
Check if you're running with seeAllData = true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@isTest | |
public static void it_should_say_seeall_is_false() { | |
Boolean seeAllData = true; | |
try { | |
ConnectApi.UserProfiles.getUserProfile(null, UserInfo.getUserId()); | |
} catch (UnsupportedOperationException ex) { | |
seeAllData = false; | |
} | |
System.assert(!seeAllData, 'See All data returned true'); | |
} | |
@isTest(seeAllData=true) | |
public static void it_should_say_seeall_is_true() { | |
Boolean seeAllData = true; | |
try { | |
ConnectApi.UserProfiles.getUserProfile(null, UserInfo.getUserId()); | |
} catch (UnsupportedOperationException ex) { | |
seeAllData = false; | |
} | |
System.assert(seeAllData, 'See All data returned false'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment