You need to sign in to do that
Don't have an account?
Ganta Suresh
Please help me what exactly this test class is totally doing.?
@isTest
public class Transaction_TDSaveTest
{
static testmethod void upload()
{
RecordType rt=[Select Id,Name from RecordType where Name='TD Attestation' and SObjectType='ROD_Attestation__c'];
ROD_Attestation__c rd=new ROD_Attestation__c();
rd.TD1_Terms_Not_based_on_Ref__c='Yes';
rd.TD2_Pmts_based_on_Pro_Rata__c='Yes';
rd.TD3_Mgmt_Fee_Less_than_7_percent__c='Yes';
rd.TD4_Outside_Agreements_Vetted__c='Yes';
rd.RecordTypeId=rt.Id;
insert rd;
ApexPages.StandardController std=new ApexPages.StandardController(rd);
Transaction_TDSave td=new Transaction_TDSave(std);
td.upload();
}
}
public class Transaction_TDSaveTest
{
static testmethod void upload()
{
RecordType rt=[Select Id,Name from RecordType where Name='TD Attestation' and SObjectType='ROD_Attestation__c'];
ROD_Attestation__c rd=new ROD_Attestation__c();
rd.TD1_Terms_Not_based_on_Ref__c='Yes';
rd.TD2_Pmts_based_on_Pro_Rata__c='Yes';
rd.TD3_Mgmt_Fee_Less_than_7_percent__c='Yes';
rd.TD4_Outside_Agreements_Vetted__c='Yes';
rd.RecordTypeId=rt.Id;
insert rd;
ApexPages.StandardController std=new ApexPages.StandardController(rd);
Transaction_TDSave td=new Transaction_TDSave(std);
td.upload();
}
}
This is a Test Class for Transaction_TDSaveTest , The test class has one test method called upload() which is Queriing a record type called "TD Attestation" for the ROD_Attestation__c object.
Creates a new ROD_Attestation__c record and sets some fields to "Yes" values.
Inserts the ROD_Attestation__c record into the database.
Creates an instance of the ApexPages.StandardController class and passes in the ROD_Attestation__c record as a parameter.
Creates an instance of the Transaction_TDSave class and passes in the ApexPages.StandardController instance as a parameter.
Calls the upload() method on the Transaction_TDSave instance to test its functionality.
If the above information helps please mark this as Best Answer.
Thank you.
All Answers
This is a Test Class for Transaction_TDSaveTest , The test class has one test method called upload() which is Queriing a record type called "TD Attestation" for the ROD_Attestation__c object.
Creates a new ROD_Attestation__c record and sets some fields to "Yes" values.
Inserts the ROD_Attestation__c record into the database.
Creates an instance of the ApexPages.StandardController class and passes in the ROD_Attestation__c record as a parameter.
Creates an instance of the Transaction_TDSave class and passes in the ApexPages.StandardController instance as a parameter.
Calls the upload() method on the Transaction_TDSave instance to test its functionality.
If the above information helps please mark this as Best Answer.
Thank you.
public class Transaction_TDSave {
public ROD_Attestation__c rod{get;set;}
public Id agrId {get;set;}
public Id rt{get;set;}
public Id facId{get;set;}
public Transaction_TDSave(ApexPages.StandardController std)
{
this.rod=(ROD_Attestation__c)std.getRecord();
this.agrId=ApexPages.currentpage().getParameters().get('ArrangementId');
this.rt=ApexPages.currentpage().getParameters().get('rtId');
this.facId=ApexPages.currentpage().getParameters().get('FacilityId');
}
public PageReference Upload()
{
RecordType rta=[Select Id,Name from RecordType where Name='TD Attestation' and SObjectType='ROD_Attestation__c'];
ROD_Attestation__c rd=new ROD_Attestation__c();
rd.TD1_Terms_Not_based_on_Ref__c=rod.TD1_Terms_Not_based_on_Ref__c;
rd.TD2_Pmts_based_on_Pro_Rata__c=rod.TD2_Pmts_based_on_Pro_Rata__c;
rd.TD3_Mgmt_Fee_Less_than_7_percent__c=rod.TD3_Mgmt_Fee_Less_than_7_percent__c;
rd.TD4_Outside_Agreements_Vetted__c=rod.TD4_Outside_Agreements_Vetted__c;
//rd.TD5_Non_Compliance_with_AKS__c=rod.TD5_Non_Compliance_with_AKS__c;
rd.RecordTypeId=rta.Id;
rd.Arrangement__c=agrId;
//rd.Attestation_Status__c='Yes';
insert rd;
/*Eagle_Arrangement__c agr=[Select Id,TD_AKS_Checklist__c from Eagle_Arrangement__c where id=:agrId];
if(rd.TD1_Terms_Not_based_on_Ref__c=='Yes' && rd.TD2_Pmts_based_on_Pro_Rata__c=='Yes' && rd.TD3_Mgmt_Fee_Less_than_7_percent__c=='Yes' && rd.TD4_Outside_Agreements_Vetted__c=='Yes')
{
agr.TD_AKS_Checklist__c=true;
}
else
{
agr.TD_AKS_Checklist__c=false;
}
update agr;*/
PageReference pr =new PageReference ('/'+facId);
return pr;
}
}
Can you please post this Class as a Seperate question to be addressed .
Thank you.