1
2
3
4
5
6
7
8
9
10
11
12
| @isTest
| private class testBeforeInsertUpdateOnUser {
|
| static testMethod void myUnitTest() {
| User targetUser = [SELECT Id, LastName, FirstName, Alias, Alias__c FROM User WHERE Id = :userInfo.getUserId()];
| targetUser.LastName = 'last';
| targetUser.FirstName = 'First';
| update targetUser;
| User targetUser02 = [SELECT Id, LastName, FirstName, Alias, Alias__c FROM User WHERE Id = :userInfo.getUserId()];
| System.assertEquals( 'lastFirst', targetUser02.Alias__c, '001');
| }
| }
|
|