有人可以解释这段代码对我做了什么吗?我不明白这些system.debug
行的目的。
Test.startTest();
// 1. First check to see if it's a brand new Owner ID
System.debug('first test'); // Creating a new opportunity to start Trigger
Opportunity newtestOpp1 = TestUtil.initOpportunity(TestUtil.initAccount(),TestUtil.initContact());
User testUser1 = TestUtil.initUser();
newtestOpp1.OwnerId = testUser1.Id;//setting OwnerId
System.debug('The opp owner should be null' + newtestOpp1.Op_Owner__c);
try{
insert newtestOpp1;
} catch ( DMLException d ) {
System.debug(d);
}
System.debug('The opp owner should not be null' + newtestOpp1.Op_Owner__c);