Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Engagement Tests rely on rollup opps triggers setting boolean to be true #51

Open
greenstork opened this issue Dec 30, 2011 · 0 comments

Comments

@greenstork
Copy link
Contributor

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);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant