Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Java by evhenii.chernykh ( 14 years ago )
static testMethod void testProcessApprovement() {
    //setup test parameters and attibutes
    TestDataClass.createV3WIPSetting();
    TestDataClass.createFeatureAccessAllOnSetting();
    //setup test data
    Wonga_Card__c wongaCard = new Wonga_Card__c();
    wongaCard.V3_Card_Id__c = 'Test Id';

    Manual_Balance_Adjustment__c credit = new Manual_Balance_Adjustment__c();
    credit.Amount_Requested__c = 100.0;
    credit.Type__c = 'Credit';
    credit.CurrencyIsoCode = 'GBP';
    credit.Reason__c = 'Test Reason';
    credit.Status__c = 'Approve';

    insert wongaCard;
     
    credit.Wonga_Card__c = wongaCard.id;
     
    insert credit;
     
    Test.setCurrentPage(Page.WongaCard);
    ApexPages.Standardcontroller controller = new ApexPages.Standardcontroller(wongaCard);
     
    Test.startTest();
    WongaCardExtension extension = new WongaCardExtension(controller);
    extension.SelectedAdjustmentId = credit.Id;
    extension.AcceptAdjustment();
    Test.stopTest();
}

 

Revise this Paste

Parent: 52629
Children: 52634
Your Name: Code Language: