Groundwire/GWBase — Issue #51: Engagement Tests rely on rollup opps triggers setting boolean to be true
Author: greenstork
Created: 2011-12-30 05:41:32+00:00
State: open

If the Opp Rollup Settings to fire rollups from a trigger is turned off, the engagement tests will fail, currently lines 1066-1117 of the code:

if (INCOPPS) {
// recent small donation only
Contact con6P = conP.get(TestCons[6].Id);
System.AssertEquals(DONORLVL1,con6P.Engagement_Level_Numeric__c);
System.AssertEquals(DONORLVL1,con6P.Engagement_Peak_Numeric__c);
System.AssertEquals(lvlNameMapTest.get(DONORLVL1),con6P.Engagement_Peak__c);
System.AssertEquals(startDateRecent,con6P.Last_Leadership_Action_Date__c);
System.AssertEquals(startDateRecent,con6P.First_Action_Date_Curr_Level__c);

// recent small donation & maj donation (should work out to donor tier 3)
Contact con7P = conP.get(TestCons[7].Id);
System.AssertEquals(DONORLVL2+1,con7P.Engagement_Level_Numeric__c);
System.AssertEquals(lvlNameMapTest.get(DONORLVL2+1),con7P.Engagement_Level__c);
System.AssertEquals(DONORLVL2+1,con7P.Engagement_Peak_Numeric__c);
System.AssertEquals(startDateRecent,con7P.Last_Leadership_Action_Date__c);
System.AssertEquals(giftYearStartDate,con7P.First_Action_Date_Curr_Level__c);

// historical maj gift, recent small gift & campaign
Contact con8P = conP.get(TestCons[8].Id);
integer lvlnow = (DONORLVL1>3) ? DONORLVL1 : 3;
System.AssertEquals(lvlnow,con8P.Engagement_Level_Numeric__c);
System.AssertEquals(lvlNameMapTest.get(lvlnow),con8P.Engagement_Level__c);
System.AssertEquals(DONORLVL2,con8P.Engagement_Peak_Numeric__c);

// 2 gifts, one lesser action
Contact con9P = conP.get(TestCons[9].Id);
System.AssertEquals(DONORLVL2,con9P.Engagement_Level_Numeric__c);
System.AssertEquals(DONORLVL2,con9P.Engagement_Peak_Numeric__c);
System.AssertEquals(lvlNameMapTest.get(DONORLVL2),con9P.Engagement_Peak__c);
System.AssertEquals(startDateRecent,con9P.Last_Leadership_Action_Date__c);
System.AssertEquals(giftYearStartDate,con9P.First_Action_Date_Curr_Level__c);

// gift this yr
Contact con10P = conP.get(TestCons[10].Id);
System.AssertEquals(DONORLVL1,con10P.Engagement_Level_Numeric__c);
System.AssertEquals(DONORLVL1,con10P.Engagement_Peak_Numeric__c);
System.AssertEquals(lvlNameMapTest.get(DONORLVL1),con10P.Engagement_Peak__c);
// System.AssertEquals(system.today().addMonths(-2),con10P.Engagement_Level_Mod_Date__c);

// HH mbr w/ no other activity, shouldn't get HH donation credit
Contact con19P = conP.get(consHH[0].Id);
System.AssertEquals(0,con19P.Engagement_Level_Numeric__c);
System.AssertEquals(0,con19P.Engagement_Peak_Numeric__c);
System.AssertEquals(null,con19P.Last_Leadership_Action_Date__c);

// HH mbr other activity, should get HH donation credit
Contact con20P = conP.get(consHH[1].Id);
System.AssertEquals(DONORLVL2,con20P.Engagement_Level_Numeric__c);
System.AssertEquals(DONORLVL2,con20P.Engagement_Peak_Numeric__c);
System.AssertEquals(startDateRecent,con20P.Last_Leadership_Action_Date__c);
System.AssertEquals(startDateRecent,con20P.First_Action_Date_Curr_Level__c);
}