+ Start a Discussion
NNRNNR 

test class urgent requirment

 it is urgent Requirement plz help me out.
 // Constructor 
    public DEOSearchPageController(){
        Account=new Account();
        Opportunity= new Opportunities__c ();
        Secondary= new Secondary_Customer_Details__c();
        wrappers=new List<Family__c>();
        SECCCID=ApexPages.currentPage().getParameters().get('secId');
        AcccountID=ApexPages.currentPage().getParameters().get('accId');//DEOVfPagerforClient id can capture
        DEOVPC=ApexPages.currentPage().getParameters().get('DEOVPC');
        if(String.isNotBlank(AcccountID) && String.isNotBlank(DEOVPC)){
          try{
               acc=[  select Name,NCO_Occupation_Code__c,Main_Product_or_Service_sold__c,RecordtypeId from Account where Id=:AcccountID];
                 Account=acc;
                 SameFlag=Account.Same_As_Communication_Address__c;
                 system.debug('account.Same_As_Communication_Address__c'+account.Same_As_Communication_Address__c);
                 system.debug('Account************'+Account);
          }
          catch(QueryException e){
          }
           
        }
         DVPOP=ApexPages.currentPage().getParameters().get('DVPOP');
         system.debug('SECCCID*****'+SECCCID+'DEOVPC********'+DVPOP);
         if(String.isNotBlank(SECCCID)&&String.isNotBlank(DVPOP)){
             try{
                  // old soql sec =[select Id, Name ,Account__c,/* by ashok Guardian_Age__c,*/NCO_Occupation_Code__c,Industry__c,Main_Product_or_Service_sold__c,Brief_Description_of_Occupation_words__c,Salutation__c,Alias__c,Last_Name__c ,FH_FirstName__c ,FH_MiddleName__c ,FH_LastNames__c,Date_of_Birtht__c,Gender__c,Mother_Tongue__c ,Educations__c,Marital_Statuss__c,Identity_Proofs__c,Identity_ProofNo__c,Type_of_Relation__c,Relationdhip_with_Secondary_Customer__c,Proof_b_w_Borrower_and_Co_Borrower__c,Nature_of_Employment__c,Type_of_Employment__c,Frequency_of_wages__c ,If_Others_Please_Specify__c,Months3__c,Nominee_Name__c ,Nominee_Age_SC__c,Nominee_Relationship_with_Primary__c,Guardian_Name__c,Guardian_Relationship__c,Nominee_Bank_Name__c,Nominee_Bank_Account_Number__c,BALIC_Member_No__c,Policy_Period_Start_Date__c,Policy_Period_End_Date__c,Premium_Paid__c,Sum_Assured__c,BALIC_Member_No_SC__c ,Policy_Period_Start_Date_SC__c,Policy_Period_End_Date_SC__c ,Premium_Paid_SC__c ,Sum_Assured_SC__c,Length_of_Business_Service_Years__c from Secondary_Customer_Details__c  where Id =:SECCCID limit 1];
                    sec=[   select Id, Name ,Account__c,NCO_Occupation_Code__c,Brief_Description_of_Occupation_words__c,
                            Industry__c,Main_Product_or_Service_sold__c,Salutation__c,Last_Name__c ,
                            Length_of_Business_Service_Years__c,Aadhar_Card__c,Aadhar_Card_No__c,Guardian_Age__c,
                            Spouse_First_Name_SC__c,Spouse_Last_Name_SC__c  from Secondary_Customer_Details__c  where Id =:SECCCID limit 1];
             }
             catch(QueryException e){
                    system.debug('********'+e);
                     //LogsExceptionClass.insertLog(e.getMessage(),e.getLineNumber(),e.getTypeName(),String.valueOf(e.getcause()),e.getStackTraceString());
            }
            String accountId=sec.Account__C;
            system.debug('accountId*********'+accountId);
            if(String.isNotBlank(accountId)){
                try{
                    acc=[  select Name,NCO_Occupation_Code__c,Main_Product_or_Service_sold__c,RecordtypeId from Account where Id=:AcccountID];
                     account=acc;
                     SameFlag=account.Same_As_Communication_Address__c;
                     system.debug('account.Same_As_Communication_Address__c'+account.Same_As_Communication_Address__c);
                     string accountIds = acc.Id;
                
                
                     String sql='select name,Gender__c,Chief_wage_earner_of_the_family__c,Education__c,Marital_Status__c,Occupation_Types__c,CIS__c FROM Family__c where CIS__c=:accountIds';
                     wrappers= Database.Query(sql);
               
                }
                catch(QueryException e){
                    system.debug('********'+e);
                     //LogsExceptionClass.insertLog(e.getMessage(),e.getLineNumber(),e.getTypeName(),String.valueOf(e.getcause()),e.getStackTraceString());
                }   
            }
             
         }
         DSANew=ApexPages.currentPage().getParameters().get('DSANew');
         system.debug('SECCCID*****'+SECCCID+'DSANew********'+DSANew);
         if(string.isNotBlank(DSANew) && String.isNotBlank(SECCCID)){
                try{ 
                 //old soql sec =[select Id, Name ,NCO_Occupation_Code__c,Industry__c,Main_Product_or_Service_sold__c,Brief_Description_of_Occupation_words__c,Account__c,Salutation__c,Spouse_First_Name_SC__c,Spouse_Last_Name_SC__c,Alias__c,Last_Name__c ,FH_FirstName__c ,FH_MiddleName__c ,FatherOrHusband__c,FH_LastNames__c,Date_of_Birtht__c,Gender__c,Mother_Tongue__c ,Educations__c,Marital_Statuss__c,Identity_Proofs__c,Identity_ProofNo__c,Type_of_Relation__c,Relationdhip_with_Secondary_Customer__c,Proof_b_w_Borrower_and_Co_Borrower__c,Nature_of_Employment__c,Type_of_Employment__c,Frequency_of_wages__c ,If_Others_Please_Specify__c,Months3__c,Nominee_Name__c ,Nominee_Age_SC__c,Nominee_Relationship_with_Primary__c,Guardian_Name__c,Guardian_Relationship__c,Nominee_Bank_Name__c,Nominee_Bank_Account_Number__c,BALIC_Member_No__c,Policy_Period_Start_Date__c,Policy_Period_End_Date__c,Premium_Paid__c,Sum_Assured__c,BALIC_Member_No_SC__c ,Policy_Period_Start_Date_SC__c,Policy_Period_End_Date_SC__c ,/* ashok Guardian_Age__c,*/ Premium_Paid_SC__c ,Sum_Assured_SC__c,Length_of_Business_Service_Years__c  from Secondary_Customer_Details__c  where Id =:SECCCID limit 1];
                    sec =[  select Id, Name ,Account__c,NCO_Occupation_Code__c,Brief_Description_of_Occupation_words__c,
                            Industry__c,Main_Product_or_Service_sold__c,Salutation__c,Last_Name__c ,
                            FH_FirstName__c ,FH_MiddleName__c ,FH_LastNames__c,Date_of_Birtht__c,
                            Length_of_Business_Service_Years__c,Aadhar_Card__c,Aadhar_Card_No__c,Guardian_Age__c,
                            Spouse_First_Name_SC__c,Spouse_Last_Name_SC__c from Secondary_Customer_Details__c  where Id =:SECCCID limit 1];
                        Secondary=sec;
                        String accountId=Secondary.Account__C;
                            if(String.isNotBlank(accountId)){
                                    //old soql acc=[select Name,NCO_Occupation_Code__c,Main_Product_or_Service_sold__c,Industry,Brief_Description_of_Occupation_words__c,Total_Outflow__c,DO_You_Have_Mobile_No__c ,DO_You_Have_Land_Line_No__c ,Does_the_applicant_live_in_address_spcfd__c,Net_Cash_Flow__c,Total_Inlfow__c ,Branch_Name__r.Branch_Type__c,Occupation_Description__c ,Does_Coapplicant_have_a_seperate_family__c,Specify_the_Correct_Address__c  ,Does_Coaplicant_live_in_same_address__c ,No_of_Earning_Members__c ,City_Borrower__c ,DesignationOther1__c ,Length_of_business_serviceYears__c ,Batch_Leader__c,Employment_Type__c ,isPersonAccount,Father_Husband_s_Middle_Name__c , Account_Status__c ,Batch_Leader_Credit_Bureau_Rejected__c,Area_lookup__c,CIS_No_new__c,Branch_Name__c,Application_serial_number__c,Net_Cash_Flow_120_EMI__c,InstaKit_Account_No__c,Customer_Id__c,Aadhar_Card_No__c,Aadhar_Card__c,Product_type__c,Opted_for_NPS_Lite__c, Customer_Consent_on_NPS_Lite_Debit__c,test1__c, Amount_debited_for_NPS_LITE_inclusion__c,Spouse_Last_Name__c,Spouse_First_Name__c, Enrollment_Date__c,Default_Status__c,URN_No_Asset__c,Person_Account_ID__c ,Enrollment_Type__c ,CRE_Sales_NameLP__c,All_application_in_batch_sanctioned__c,Last_URNNumber__c,No_of_Groups_Attached__c,TCBIL_Last_URN__c,Card_Dispatch_Status__c,Card_Print_Status__c,Salutation__c,Alias__c,LastName__c,DeDuplication_Status__c,DOB_Borrower__c, Age_of_Borrower1__c,Father_OR_Husband__c,Marital_Status__c,Father_Husband_s_First_Name__c ,Education1__c, F_H_s_Last_Name__c ,IdentityProofNo__c ,Sex__c,MotherTongue__c,IdentityProof__c ,IdentityProof_coborr__c,IdentityProofNo1__c,Religion__c ,Caste__c ,Natureofemployment__c,Type_of_Employment__c ,Occupation_Code__c,DesignationOther__c ,Designation__c ,Frequency_of_wages__c ,Months1__c  ,Pin_COntacts__c ,Landmark_contacts__c, No_of_Years_in_Current_Residence__c , Outflow_Excluding_Financial_expenses__c, Financial__c , Home_Telephone_No__c,OWN_PP_Home__c ,Office_Telephone_No__c , Ext_Res__c ,Mobile_NO_Contact__c,OWN_PP__c ,Door_No_Main_Borrower__c,Street_Name_main__c , Present_No_of_Years_in_Current_City__c , Is_the_residence_in_a__c, Other_Residence__c , Door_No_contact__c, Street_Name_Contact__c, City_Contact__c , Pin_contact__c  , Landmark__c  from Account where Id=:accountId limit 1];
                                    try{ acc=[  select Name,NCO_Occupation_Code__c,Main_Product_or_Service_sold__c,RecordtypeId from Account where Id=:AcccountID];
                                            account=acc;
                                            SameFlag=account.Same_As_Communication_Address__c;
                                            system.debug('account.Same_As_Communication_Address__c'+account.Same_As_Communication_Address__c);
                                            system.debug('accountId****'+accountId);
                                            //old soql String sql = 'SELECT Age__c,Amount_Earned_per_month_Dependent__c,CreatedById,CreatedDate,CurrencyIsoCode,Family_setup__c,Frequency_of_income_earned1__c,Id,IsDeleted,LastModifiedById,LastModifiedDate,MigratedRecordsFlag__c,Name,Occupation_Class_if_student__c,Occupation_Code_family__c,education__c,Chief_wage_earner_of_the_family__c,Occupation_Description_Family__c,OwnerId,Personal_Assets__c,Personal_Liabilities__c,Relationship_with_the_family_member__c,Status_of_Health__c,CIS__c FROM Family__c where CIS__c=:accountId';
                                            String sql='select name,Gender__c,Education__c,Chief_wage_earner_of_the_family__c,Marital_Status__c,Occupation_Types__c,CIS__c FROM Family__c where CIS__c=:accountId';
                                            wrappers= Database.Query(sql);
                                            system.debug('Families ***********'+Families );
                                            //old soql op=[Select Id,Loan_Jump_checkbox__c ,MIMO_Account_ID__c,CRM_s_Signature_Date_Time__c,CRE_Collection_s_NameLp__c,CRM_s_Name_Lookup__c,MIMO_Closed_customer__c,Account__c,CRE_Sales_Signature_Date_Time__c,Installment_Amount__c,CRE_Sales_NameLP__c,Does_Coapplicant_have_a_seperate_family__c,Does_Coaplicant_live_in_same_address__c,Specify_the_Correct_Address__c,Does_the_applicant_live_in_address_spcfd__c,Loan_Purpose_Description__c,Declaration_Completed__c,Loan_Purpose__c,Income_Assesment_remarks__c,No_of_Family_Members__c,Securityb__c,Loan3_Frequency__c,Repayment_Amount_p_ms__c,Loan_outstandingb__c,Original_Loan_Amountt__c,Loan3_Purpose__c,Sourcet__c,Securitys__c,Loan2_Frequency__c,Repayment_Amount_p_mb__c,Loan_outstandings__c,Original_Loan_Amounts__c,Purposes__c,Sources__c,Security__c,Loan1_frequency__c,Repayment_Amount_p_m__c,Loan_Outstanding__c,Original_Loan_Amount__c,Purpose__c,Source1__c,Vehicle_Used__c,PressureCooker_s_new__c,Durables_Owned__c,Electric_Fans_new__c,Type_Of_Residence__c,Type_of_property_owned_in_city__c,Residential_Status_Currently__c,Gold_new__c,Post_Office_SB_Ac__c,CHITS_new__c,Savings_Others_new__c,Savings_A_C_new__c,RD_FD_recurring_new__c,SHG_Savings_new__c,Opportunity_Status__c,OwnerId,URN__c,Status__c,Stage__c,CloseDate__c,Loan_Amount__c,Loan_Cycle__c,Probability__c,Product_Name__c,Date_of_Credit_check__c,Credit_Bureau_Status__c,Low_Credit_Score_Deviation__c,Type_of_Closure_Writeoff_text__c,Opp_Selected__c,Opted_for_Prepaid__c,Closure_Letter_Attached__c,Amcl__c,Loan_account_No__c,Mcl__c,CBS_Loan_Status__c,Customer_Type__c,Credit_check_with_history__c,Previous_Record_Type__c,Record_Type_Changed__c,Center_Number__c,Margin_Money__c,Next_DisbursementDate__c,Credit_Bureau_Rejected_Reason__c,Actual_DisbursementDate__c,Group_Leader__c,Product_Application_No__c,Group_No__c,Is_the_Net_CashFlow_120_of_EMI__c,Previous_Opportunity_CBS_Loan_Status__c,Secondary_Customer_Details__c,Name,Does_your_family_own_any_agricul_land__c,If_yes_No_of_Acres__c from Opportunities__c where Account__c=:accountId and (Status__c= 'Assigned' OR Status__c= 'Active') Limit 1];
                                            op=[Select Id,Remarks_Official__c,Amount_debited_for_NPS_LITE_inclusion__c,Customer_Consent_on_NPS_Lite_Debit__c,CRE_Sales_NameLP__r.Employee_Code__c,Total_no_of_non_earning_members__c,Loan_Jump_checkbox__c ,MIMO_Account_ID__c,CRM_s_Signature_Date_Time__c,CRE_Collection_s_NameLp__c,CRM_s_Name_Lookup__c,MIMO_Closed_customer__c,Account__c,CRE_Sales_Signature_Date_Time__c,Installment_Amount__c,CRE_Sales_NameLP__c,Does_Coapplicant_have_a_seperate_family__c,Does_Coaplicant_live_in_same_address__c,Specify_the_Correct_Address__c,Does_the_applicant_live_in_address_spcfd__c,Loan_Purpose_Description__c,Declaration_Completed__c,Loan_Purpose__c,Income_Assesment_remarks__c,No_of_Family_Members__c,Securityb__c,Loan3_Frequency__c,Repayment_Amount_p_ms__c,Loan_outstandingb__c,Original_Loan_Amountt__c,Loan3_Purpose__c,Sourcet__c,Securitys__c,Loan2_Frequency__c,Repayment_Amount_p_mb__c,Loan_outstandings__c,Original_Loan_Amounts__c,Purposes__c,Sources__c,Security__c,Loan1_frequency__c,Repayment_Amount_p_m__c,Loan_Outstanding__c,Original_Loan_Amount__c,Purpose__c,Source1__c,Vehicle_Used__c,PressureCooker_s_new__c,Durables_Owned__c,Electric_Fans_new__c,Type_Of_Residence__c,Type_of_property_owned_in_city__c,Residential_Status_Currently__c,Gold_new__c,Post_Office_SB_Ac__c,CHITS_new__c,Savings_Others_new__c,Savings_A_C_new__c,RD_FD_recurring_new__c,SHG_Savings_new__c,Opportunity_Status__c,OwnerId,URN__c,Status__c,Stage__c,CloseDate__c,Loan_Amount__c,Loan_Cycle__c,Probability__c,Product_Name__c,Date_of_Credit_check__c,Credit_Bureau_Status__c,Low_Credit_Score_Deviation__c,Type_of_Closure_Writeoff_text__c,Opp_Selected__c,Opted_for_Prepaid__c,Closure_Letter_Attached__c,Amcl__c,Loan_account_No__c,Mcl__c,CBS_Loan_Status__c,Customer_Type__c,Credit_check_with_history__c,Previous_Record_Type__c,Record_Type_Changed__c,Center_Number__c,Margin_Money__c,Next_DisbursementDate__c,Credit_Bureau_Rejected_Reason__c,Actual_DisbursementDate__c,Group_Leader__c,Product_Application_No__c,Group_No__c,Is_the_Net_CashFlow_120_of_EMI__c,Previous_Opportunity_CBS_Loan_Status__c,Secondary_Customer_Details__c,Name,Does_your_family_own_any_agricul_land__c,If_yes_No_of_Acres__c from Opportunities__c where Account__c=:accountId and (Status__c= 'Assigned' OR Status__c= 'Active') Limit 1];
                                            system.debug('op################'+op);
                                            Opportunity=op;
                                            system.debug('Opportunity@@@@@@@@@@@@'+Opportunity);
                                    }
                                    catch(QueryException e){
                                    }
                            }
                }
                catch(QueryException e){
                    system.debug('********'+e);
                }
            }   
         smalGroupProduct = new Product2();
        smalGroupProduct=[SELECT id,PRODUCT_CODE__c,Name FROM Product2 WHERE PRODUCT_CODE__c = 814 Limit 1];
        SMALLGROUPSPECIAL = new Product2();
        SMALLGROUPSPECIAL=[SELECT id,PRODUCT_CODE__c,Name FROM Product2 WHERE PRODUCT_CODE__c = 815 Limit 1];
        RecordType AccountRt= [SELECT DeveloperName,Id,Name FROM RecordType where DeveloperName='Client_Draft_Mode'];
        RecordType SecondaryRt= [SELECT DeveloperName,Id,Name FROM RecordType where DeveloperName='For_DEO' and sobjectType='Secondary_Customer_Details__c'];
        system.debug('*****SecondaryRt*******'+SecondaryRt.Name+'AccountRt'+AccountRt.name);
        account.RecordtypeId=AccountRt.Id;
        Secondary.RecordtypeId=SecondaryRt.Id;
        system.debug('account.RecordtypeId'+account.RecordtypeId);
        Integer size1=wrappers.size();
        system.debug('size1'+size1);
        for(integer i=0;size1<8;i++){
            wrappers.add(new family__c());
           size1++; 
       }
 }
 
Abhi_TripathiAbhi_Tripathi
Hi NNR,

Please go through this of writing test class and their basics, this will help you out for sure
http://abhithetechknight.blogspot.in/2013/10/salesforce-test-class-basics.html

Regards,
Abhi Tripathi