1
누군가이 코드가 내게 무엇을하고 있는지 설명 할 수 있습니까? 나는 system.debug
라인의 목적을 이해하지 못한다. 이 워크 플로우 또는 트리거 어떤 종류의 기회 기록을 삽입시 Op_Owner__c
필드에 값을 설정 여부를 테스트해야하는데 같은여기에이 테스트 케이스의 목적은 무엇입니까?
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);