Created
December 24, 2015 14:15
-
-
Save msrivastav13/7e100f8ed2607d4ab71a to your computer and use it in GitHub Desktop.
Test class
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 | |
private class TestCreatedDateSetter{ | |
static testmethod void createAccountTest(){ | |
Account acc = new Account(); | |
acc.Name = 'Test'; | |
insert acc; | |
DateTime myDateTime = DateTime.newInstance(1997, 1, 31, 7, 8, 16); | |
Test.setCreatedDate(acc.Id, myDateTime ); | |
Test.startTest(); | |
system.assertEquals([Select CreatedDate from Account].CreatedDate,myDateTime); | |
Test.stopTest(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment