Created
September 18, 2019 23:18
-
-
Save shinchit/47e50cbcd1c1c24bffc22d00c5356091 to your computer and use it in GitHub Desktop.
This file contains 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 | |
public with sharing class Some_Test { | |
private Account acc {get; set;} | |
@testSetup static void setup() { | |
acc = new Account(Name = 'account1'); | |
insert acc; | |
System.debug(acc.Id); // We can confirm Account Id on the debug log. | |
} | |
@isTest static void testMethod1() { | |
System.debug(acc.Id); // We'll get an error. NullPointerException occur!! | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment