Guest User

Untitled

a guest
Feb 17th, 2018
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. @isTest static void User_can_get_contact_email()
  2. {
  3. // Arrange
  4. System.runAs(createUser())
  5. {
  6. // Act
  7.  
  8. // Assert
  9. system.assertEquals('contact@place.com', contact.Email, 'Email does not match');
  10. }
  11. }
  12.  
  13. public static User createUser()
  14. {
  15. Profile profile = [select Id from profile where name = 'Standard User'];
  16. User user = new User(
  17. Alias = 'standard',
  18. Email = 'standarduser@testorg.com',
  19. EmailEncodingKey = 'UTF-8',
  20. LastName = 'Testing',
  21. LanguageLocaleKey = 'en_US',
  22. LocaleSidKey = 'en_GB',
  23. ProfileId = profile.Id,
  24. TimeZoneSidKey = 'Europe/London',
  25. UserName = 'standardusertesting@gearsettest.com'
  26. );
  27.  
  28. return user;
  29. }
Add Comment
Please, Sign In to add comment