+ Start a Discussion
Geetha BGeetha B 

i am unable to cove the code coverage for this class please help me

public class CustomerFeedback {

   public String ResponcetoEnquiryT{get;set;}
   public String ResponcetoEnquiryC{get;set;}
   Public String ids;
 
   Public string dtt{get;set;}
   public Customer_Feedback__c cfb{get;set;}
  
    public CustomerFeedback(ApexPages.StandardController controller)
    {
     dtt = System.today().format();
    
     cfb = new Customer_Feedback__c();
 
    ids = ApexPages.currentPage().getParameters().get('id');
   
     system.debug('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Id=='+ids );
    cfb = [select id, Company_Name__c,Job_Title__c,Date__c,Contact__c,Type_of_Industry__c from Customer_Feedback__c where id =: ids];
 
    
    }
   
   
   
   
    public List<SelectOption> getTypes()
   {
           
            Schema.sObjectType sobject_type = Customer_Feedback__c.getSObjectType();

            Schema.DescribeSObjectResult sobject_describe = sobject_type.getDescribe();

            Map<String, Schema.SObjectField> field_map = sobject_describe.fields.getMap();
         
            List<Schema.PicklistEntry> pick_list_values = field_map.get('Response_to_Enquiry__c').getDescribe().getPickListValues();
            List<Schema.PicklistEntry> pick_list_values1 = field_map.get('Response_to_enquiry_C__c').getDescribe().getPickListValues();
            List<selectOption> options = new List<selectOption>();

           for (Schema.PicklistEntry a : pick_list_values) {
                      options.add(new selectOption(a.getLabel(), a.getValue()));
          }
      return options;
      }

}
Geetha BGeetha B
this is the test class i have writen but my test is fail
please help me

@isTest
public class TestCustomerFeedback1
{
    static testMethod void CustomerFeedback1()
    {
   
      Account acc = new Account(Name='some acc',CurrencyIsoCode='INR');
      insert acc;
  
      Contact con = new Contact(LastName='somename',AccountId=acc.id,Email='eswar.yelike@gmail.com');
      insert con;
          
      Customer_Feedback__c cusf = new Customer_Feedback__c();
      cusf.Rating_of_current_visit__c = 'Poor';
      cusf.Response_to_enquiry_C__c = 'Average';
      cusf.Any_open_issues_C__c = true;
      cusf.Contact__c = con.id;
      Insert cusf;
     
        
   ApexPages.StandardController sc = new ApexPages.StandardController(cusf);
     
     CustomerFeedback cus= new CustomerFeedback(sc);
     ApexPages.currentPage().getParameters().put('Id',cusf.id);
     cus.getTypes();
    
  
    }}