Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @isTest static void User_can_get_contact_email()
- {
- // Arrange
- System.runAs(createUser())
- {
- // Act
- // Assert
- system.assertEquals('contact@place.com', contact.Email, 'Email does not match');
- }
- }
- public static User createUser()
- {
- Profile profile = [select Id from profile where name = 'Standard User'];
- User user = new User(
- Alias = 'standard',
- Email = 'standarduser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'Testing',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_GB',
- ProfileId = profile.Id,
- TimeZoneSidKey = 'Europe/London',
- UserName = 'standardusertesting@gearsettest.com'
- );
- return user;
- }
Add Comment
Please, Sign In to add comment