Thanks for the help yesterday. I have my trigger written and am now working on my test class.
I am totally confused by the developer console and the testing process. Yesterday, my test results in the Developer Console showed 45% code coverage (in the bottom left portion of the TEST tab). Today, when I looked at my trigger in SF, it showed 72% coverage. I updated my trigger this morning to add new conditions. I've tested the trigger in my Sandbox, by updating each condition on the parent record and achieving the desired result on the child record.
I ran my tests again from the Class page and it passed. Looking at my trigger again (on the Trigger page), it shows 72% coverage. I switched over to Developer Console and tested the Class again. It gives a message of "Success", but shows nothing at all on the Tests tab. When I open the trigger in the Developer Console, it says Code Coverage: None. Yesterday, I could see the red and blue lines on my trigger, today, I get nothing.
I'm getting frustrated, as I have no idea how much coverage my trigger has... let alone if I am even doing this correctly. This "simple" update of one field has turned into 155 lines of code, which I'm sure is due to my crappy apex writing.
Here is my test class:
@isTest
public class UpdateStatusTest {
testMethod static void testUpdateStatus(){
Account a = new Account(Name='Test Account 1', vRad_Company_Type__c = 'Other', OwnerId = '00570000001RigK', Operational_Status__c='Operational',
Nighthawk_Service_Rep__c = 'Tier 1', Incumbent_Lookup__c='a067000000k24FL', Practice_Live_Date__c=system.today(), BillingState='MN');
insert a;
System.debug('Account a:'+a);
Master_Contract__c MC = new Master_Contract__c(Practice__c = a.id, Contract_Status__c = 'Draft');
insert MC;
System.debug('Master_Contract__c MC:'+MC);
Account aU = new Account(id=a.id,Operational_Status__c = 'Lost');
update aU;
System.debug('Account aU:'+aU);
Account aV = new Account(id=a.id,Operational_Status__c = 'Active');
update aV;
System.debug('Account aV:'+aV);
Account aW = new Account(id=a.id,Operational_Status__c = 'IT GO');
update aW;
System.debug('Account aW:'+aW);
Account aX = new Account(id=a.id,Operational_Status__c = 'Cancelled');
update aX;
System.debug('Account aX:'+aX);
}
}