Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. // Generate a random string
  2. private static string getRandomString(Integer len) {
  3. final string chars = 'abcdefghijklmnopqrstuvwxyz';
  4. string out = '';
  5.  
  6. while (out.length() < len) {
  7. Integer idx = Math.mod(Math.abs(Crypto.getRandomInteger()), chars.length());
  8. out += chars.substring(idx, idx+1);
  9. }
  10. return out;
  11. }
  12.  
  13. List<Account> acctList = new List<Account> {
  14. // Dummy account
  15. new Account(Name='DO NOT DELETE', Email='test' + getRandomString(5) + @mailinator.com')
  16. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement