function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Cameron HouserCameron Houser 

Help with Test class testing renderAs

I am getting 56% coverage, I am also getting an Attempt to de-reference a null object with this line of code 'CustomerInfoSheet ac = new CustomerInfoSheet();'

@IsTest
public class CustomerInfoSheetTest {

 static testMethod void testCustomerInfoSheet() {

     Account a = new Account();
      a.Name='TestAccount';
      a.Industry='AG';
     a.Region__c = 'Delta';
      insert a;
     
     a =[SELECT Id, Name, Industry, Region__c FROM Account testAccount WHERE Name=:a.Name];
     system.assert(true, a.Id);
     if (a != null) {
            
            }
     
       
     PageReference pageRef = Page.CustomerInfoSheet;
   pageRef.getParameters().put('id',a.id);
     test.setCurrentPage(pageRef);
     
     CustomerInfoSheet ac = new CustomerInfoSheet();
     
   
    test.startTest();  
     ac.PrintOut=a.Id;
        pageRef = ac.CustomerInfoSheet();
     System.assertEquals(pageRef.getUrl(), '/'+a.Id);
    test.stopTest();
     
 }    
}
Best Answer chosen by Cameron Houser
Cameron HouserCameron Houser
For those you find this later. The problem was I was not passing in the parameter for the If statement. Here is the solution: 
@IsTest
public class CustomerInfoSheetTest 
{
	static testMethod void testCustomerInfoSheet() 
	{
		Account acct = new Account();
		acct.Name='TestAccount';                 
		acct.Industry = 'AG';
		insert acct;
		system.debug('account inserted '+acct.Id);
		

		Test.StartTest();	


			PageReference pageRef = Page.customerinfosheet; 
			pageRef.getParameters().put('id', String.valueOf(acct.Id));
			pageRef.getParameters().put('l', 'a');
			Test.setCurrentPage(pageRef);

			CustomerInfoSheet ac = new CustomerInfoSheet();
        system.debug('CustomerInfoSheet:'+ac);

		Test.StopTest();
	}    
}

All Answers

mohdAnasmohdAnas

hi Cameron,

kindly provide the class as well 
 

Cameron HouserCameron Houser
public class CustomerInfoSheet {
    public String PrintOut { get; set; }
    public String LookupID;
	public String LookupType;
    
    
     public CustomerInfoSheet() {
        LookupID = ApexPages.currentPage().getParameters().get('id');
        LookupType = ApexPages.currentPage().getParameters().get('l');
        List<Account> a;
        
        PrintOut = '';      
		
                  
		if (LookupType == 'a' ){
			a = [select Name, Zone_Picklist__c, Custom_Application_Services__c, Region__c, Driving_Sequence__c, OwnerID, Phone, 
                 Industry, Sales_Profile__c, Equip_Ordering_Process__c, Account_Owner_Full_Name__c,
                 Buys_from_Primary__c, Buys_from_Secondary__c, Chemical__c, Small_Parts_Sources__c, Pumps_in_Service__c,
                 Current_Meters_Used__c, Dura_Brand_Awareness__c, Resicore_User__c, Number_of_Tender_Trailers_Used__c, Fertilizer_Impregnation__c,
                 Seed_Treatment__c, Regional_Mgr_Contact_Info__c, Fiscal_Year__c, A_C_Profile_Notes__c, Current_Season_Sales_Goal__c, 
                 Current_Season_Total_Orders__c, Last_Season_Sales__c, Total_Sales_2_Years_Ago__c,
                 Type from Account where Id = :LookupID];
		} 
        if (LookupType == 'z' ) {
			a = [select Name, Zone_Picklist__c, Custom_Application_Services__c, Region__c, Driving_Sequence__c, OwnerID, Phone, 
                 Industry, Sales_Profile__c, Equip_Ordering_Process__c, Account_Owner_Full_Name__c,
                 Buys_from_Primary__c, Buys_from_Secondary__c, Chemical__c, Small_Parts_Sources__c, Pumps_in_Service__c,
                 Current_Meters_Used__c, Dura_Brand_Awareness__c, Resicore_User__c, Number_of_Tender_Trailers_Used__c, Fertilizer_Impregnation__c, 
                 Seed_Treatment__c, Regional_Mgr_Contact_Info__c, Fiscal_Year__c, A_C_Profile_Notes__c, Current_Season_Sales_Goal__c, 
                 Current_Season_Total_Orders__c, Last_Season_Sales__c, Total_Sales_2_Years_Ago__c, 
                 Type from Account where Zone__c = :LookupID];
		}
 
         //	Sales_Profile__c
         String [] myPicklist = new List<String>();{
          Schema.DescribeFieldResult field = Account.Sales_Profile__c.getDescribe(); 
         for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         } 
         string test106 = '';
         for (String str : myPicklist)
         {test106 += str + ' -/- ';}
         test106 = test106.removeEnd(' -/- ');
         String SalesProfile = String.valueOf('No Value Selected - Please Select one now: '+ test106);
         
         //Type
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Type.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}}
         string test105 = '';
         for (String str : myPicklist)
         {test105 += str + ' -/- ';}
         test105 = test105.removeEnd(' -/- ');
         String Typelist = String.valueOf('No Value Selected - Please Select one now: '+ test105);
         
         //Industry
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Industry.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test104 = '';
         for (String str : myPicklist)
         {test104 += str + ' -/- ';}
         test104 = test104.removeEnd(' -/- ');
         String Industrylist = String.valueOf('No Value Selected - Please Select one now: '+ test104);
         
			//Zone_Picklist__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Zone_Picklist__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
                //PicklistEntry += '\n' + f.getLabel();
             myPicklist.add(f.getLabel());}
         	}
         string test101 = '';
         for (String str : myPicklist)
         {test101 += str + ' -/- ';}
         test101 = test101.removeEnd(' -/- ');
         String Zonelist = String.valueOf('No Value Selected - Please Select one now: '+ test101);
         
          //Custom_Application_Services__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Custom_Application_Services__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues())
            {myPicklist.add(f.getLabel());}}
         string test103 = '';
         for (String str : myPicklist)
         {test103 += str + ' -/- ';}
         test103 = test103.removeEnd(' -/- ');
         String CASlist = String.valueOf('No Value Selected - Please Select one now: '+ test103);
         
         //Region__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Region__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test107 = '';
         for (String str : myPicklist)
         {test107 += str + ' -/- ';}
         test107 = test107.removeEnd(' -/- ');
         String Regionlist = String.valueOf('No Value Selected - Please Select one now: '+ test107);
         
		//Seed_Treatment__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Seed_Treatment__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test108 = '';
         for (String str : myPicklist)
         {test108 += str + ' -/- ';}
         test108 = test108.removeEnd(' -/- ');
         String Seed_Treatmentlist = String.valueOf('No Value Selected - Please Select one now: '+ test108);
         
          //Equip_Ordering_Process__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Equip_Ordering_Process__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test109 = '';
         for (String str : myPicklist)
         {test109 += str + ' -/- ';}
         test109 = test109.removeEnd(' -/- ');
         String EQPlist = String.valueOf('No Value Selected - Please Select one now: '+ test109);
         
         //Buys_from_Primary__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Buys_from_Primary__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test102 = '';
         for (String str : myPicklist)
         {test102 += str + ' -/- ';}
         test102 = test102.removeEnd(' -/- ');
         String BFPlist = String.valueOf('No Value Selected - Please Select one now: '+ test102);
         
         //Buys_from_Secondary__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Buys_from_Secondary__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test110 = '';
         for (String str : myPicklist)
         {test110 += str + ' -/- ';}
         test110 = test110.removeEnd(' -/- ');
         String BFSlist = String.valueOf('No Value Selected - Please Select one now: '+ test110);
         
          //Chemical__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Chemical__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test111 = '';
         for (String str : myPicklist)
         {test111 += str + ' -/- ';}
         test111 = test111.removeEnd(' -/- ');
         String Chemicallist = String.valueOf('No Value Selected - Please Select one now: '+ test111);
         
          //Small_Parts_Sources__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Small_Parts_Sources__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test112 = '';
         for (String str : myPicklist)
         {test112 += str + ' -/- ';}
         test112 = test112.removeEnd(' -/- ');
         String SPSlist = String.valueOf('No Value Selected - Please Select one now: '+ test112);
         
         //Pumps_in_Service__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Pumps_in_Service__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test113 = '';
         for (String str : myPicklist)
         {test113 += str + ' -/- ';}
         test113 = test113.removeEnd(' -/- ');
         String CPISlist = String.valueOf('No Value Selected - Please Select one now: '+ test113);
         
         //Current_Meters_Used__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Current_Meters_Used__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test114 = '';
         for (String str : myPicklist)
         {test114 += str + ' -/- ';}
         test114 = test114.removeEnd(' -/- ');
         String CMUlist = String.valueOf('No Value Selected - Please Select one now: '+ test114);
         
         //Dura_Brand_Awareness__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Dura_Brand_Awareness__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test115 = '';
         for (String str : myPicklist)
         {test115 += str + ' -/- ';}
         test115 = test115.removeEnd(' -/- ');
         String DBAlist = String.valueOf('No Value Selected - Please Select one now: '+ test115);
         
          //Resicore_User__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Resicore_User__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test116 = '';
         for (String str : myPicklist)
         {test116 += str + ' -/- ';}
         test116 = test116.removeEnd(' -/- ');
         String Resicorelist = String.valueOf('No Value Selected - Please Select one now: '+ test116);
         
         //Number_of_Tender_Trailers_Used__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Number_of_Tender_Trailers_Used__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test117 = '';
         for (String str : myPicklist)
         {test117 += str + ' -/- ';}
         test117 = test117.removeEnd(' -/- ');
         String NOTTUlist = String.valueOf('No Value Selected - Please Select one now: '+ test117);
         
         //Fertilizer_Impregnation__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Fertilizer_Impregnation__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test118 = '';
         for (String str : myPicklist)
         {test118 += str + ' -/- ';}
         test118 = test118.removeEnd(' -/- ');
         String RIlist = String.valueOf('No Value Selected - Please Select one now: '+ test118);
         
         //Regional_Mgr_Contact_Info__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Regional_Mgr_Contact_Info__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
           myPicklist.add(f.getLabel());}
        	}String RMCITrueFalse = String.valueOf(' Value Selected - Please Select New Value If Applicable: True, or False');
                
         //Fiscal_Year__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.Fiscal_Year__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}
         string test119 = '';
         for (String str : myPicklist)
         {test119 += str + ' -/- ';}
         test119 = test119.removeEnd(' -/- ');
         String FiscalYList = String.valueOf('No Value Selected - Please Select one now: '+ test119);
         
         //A_C_Profile_Notes__c
         {myPicklist.clear();
             Schema.DescribeFieldResult field = Account.A_C_Profile_Notes__c.getDescribe();
        	for (Schema.PicklistEntry f : field.getPicklistValues()){
             myPicklist.add(f.getLabel());}
         	}String ACProfileNotes = String.valueOf('No Notes - Please Add One Now: ');
         
         
               
		String CustomerName = '';
        
		String Zone = '';
        String Region = '';
        String Driving_Sequence = '';
        String OwnerID;
        String Phone = '';
        String Type = '';
        Decimal CurrentSeasonSalesGoal;
        Decimal Current_Season_Total_Orders;
        Decimal Last_Season_Sales;
        Decimal Total_Sales_2_Years_Ago;
        String Industry = '';
        String Account_Owner_Full_Name = '';
        String Sales_Profile; // = '';
        String Equip_Ordering_Process = '';
        String Buys_from_Primary = '';
        String Buys_from_Secondary ='';
        String Chemical_Reps = '';
        String Small_Parts_Suppliers = '';
        String Current_Pumps_in_Service = '';
        String Current_Meters_Used = '';
        String Dura_Brand_Awareness = '';
        String Resicore_User = '';
        String Custom_Application_Services = '';
        String Number_of_Tender_Trailers_Used = '';
        String Fertilizer_Impregnation = '';
        String Seed_Treatment = '';
        Boolean Regional_Mgr_Contact_Info = Boolean.valueOf('');
        String Fiscal_Year = '';
        String A_C_Profile_Notes = '';
        
                        
        
		if (!a.isEmpty()){
			for (Account CustomerInfo : a) {
                
				CustomerName = CustomerInfo.Name;
                              
                if (!(CustomerInfo.Zone_Picklist__c == null)) { Zone = CustomerInfo.Zone_Picklist__c; }else { Zone = Zonelist;}
				if (!(CustomerInfo.Custom_Application_Services__c == null)) { Custom_Application_Services = CustomerInfo.Custom_Application_Services__c; }  else { Custom_Application_Services = CASlist;}
                if (!(CustomerInfo.Region__c == null)) { Region = CustomerInfo.Region__c; } else { Region = Regionlist;}
                if (!(CustomerInfo.Driving_Sequence__c == null)) { Driving_Sequence = String.valueOf(CustomerInfo.Driving_Sequence__c); }
                if (!(CustomerInfo.Account_Owner_Full_Name__c  == null)) { Account_Owner_Full_Name = CustomerInfo.Account_Owner_Full_Name__c; }
                if (!(CustomerInfo.Seed_Treatment__c == null)) { Seed_Treatment = CustomerInfo.Seed_Treatment__c; } else { Seed_Treatment = Seed_Treatmentlist;}
                if (!(CustomerInfo.Phone == null)) { Phone = CustomerInfo.Phone; }
              	if (!(CustomerInfo.Type == null)) { Type = CustomerInfo.Type; }else { Type = Typelist;}
                if (!(CustomerInfo.Industry == null)) { Industry = CustomerInfo.Industry; } else { Industry = Industrylist;}
                if (!(CustomerInfo.Equip_Ordering_Process__c == null)) { Equip_Ordering_Process = CustomerInfo.Equip_Ordering_Process__c; }else { Equip_Ordering_Process = EQPlist;}
                if (!(CustomerInfo.Sales_Profile__c == null)) { Sales_Profile = CustomerInfo.Sales_Profile__c; } else { Sales_Profile = SalesProfile; }
                if (!(CustomerInfo.Buys_from_Primary__c == null)) { Buys_from_Primary = CustomerInfo.Buys_from_Primary__c; } else { Buys_from_Primary = BFPlist; }
                if (!(CustomerInfo.Buys_from_Secondary__c == null)) { Buys_from_Secondary = CustomerInfo.Buys_from_Secondary__c; }else { Buys_from_Secondary = BFSlist; }
                if (!(CustomerInfo.Chemical__c == null)) { Chemical_Reps = CustomerInfo.Chemical__c ; } else { Chemical_Reps = Chemicallist; }
                if (!(CustomerInfo.Small_Parts_Sources__c == null)) { Small_Parts_Suppliers = CustomerInfo.Small_Parts_Sources__c; } else { Small_Parts_Suppliers = SPSlist; }
                if (!(CustomerInfo.Pumps_in_Service__c == null)) { Current_Pumps_in_Service = CustomerInfo.Pumps_in_Service__c; } else { Current_Pumps_in_Service = CPISlist; }
                if (!(CustomerInfo.Current_Meters_Used__c == null)) { Current_Meters_Used = CustomerInfo.Current_Meters_Used__c; }else { Current_Meters_Used = CMUlist; }
                if (!(CustomerInfo.Dura_Brand_Awareness__c == null)) { Dura_Brand_Awareness = CustomerInfo.Dura_Brand_Awareness__c; }else { Dura_Brand_Awareness = DBAlist; }
                if (!(CustomerInfo.Resicore_User__c == null)) { Resicore_User = CustomerInfo.Resicore_User__c; }else { Resicore_User = Resicorelist; }
                if (!(CustomerInfo.Number_of_Tender_Trailers_Used__c == null)) { Number_of_Tender_Trailers_Used = CustomerInfo.Number_of_Tender_Trailers_Used__c; }else { Number_of_Tender_Trailers_Used = NOTTUlist; }
                if (!(CustomerInfo.Fertilizer_Impregnation__c == null)) { Fertilizer_Impregnation = CustomerInfo.Fertilizer_Impregnation__c; }else { Fertilizer_Impregnation = RIlist; }
                //issue here is the boolean always returns a value and is never null
                if (!(CustomerInfo.Regional_Mgr_Contact_Info__c == null)) { Regional_Mgr_Contact_Info = CustomerInfo.Regional_Mgr_Contact_Info__c; } else { RMCITrueFalse= 'or true. If Field needs to be upated please select one'; }
                if (!(CustomerInfo.Fiscal_Year__c == null)) { Fiscal_Year = CustomerInfo.Fiscal_Year__c; }else { Fiscal_Year = FiscalYList; }
                if (!(CustomerInfo.A_C_Profile_Notes__c == null)) { A_C_Profile_Notes = CustomerInfo.A_C_Profile_Notes__c; }else { A_C_Profile_Notes = ACProfileNotes; }
                
                if (!(CustomerInfo.Current_Season_Sales_Goal__c == null)) { CurrentSeasonSalesGoal = CustomerInfo.Current_Season_Sales_Goal__c; }
                if (!(CustomerInfo.Current_Season_Total_Orders__c == null)) { Current_Season_Total_Orders = CustomerInfo.Current_Season_Total_Orders__c; }
                if (!(CustomerInfo.Last_Season_Sales__c == null)) { Last_Season_Sales = CustomerInfo.Last_Season_Sales__c; }
                if (!(CustomerInfo.Total_Sales_2_Years_Ago__c == null)) { Total_Sales_2_Years_Ago = CustomerInfo.Total_Sales_2_Years_Ago__c; }
                if (!(CustomerInfo.Account_Owner_Full_Name__c == null)) { OwnerID = CustomerInfo.Account_Owner_Full_Name__c; }
                
                if(CurrentSeasonSalesGoal == null) CurrentSeasonSalesGoal = 0;
                if(Current_Season_Total_Orders == null) Current_Season_Total_Orders = 0;
                if(Last_Season_Sales == null) Last_Season_Sales = 0;
                if(Total_Sales_2_Years_Ago == null) Total_Sales_2_Years_Ago = 0;
                
		
				PrintOut += '<div style="page-break-after:always;">';
				PrintOut += '<strong>Company: </strong>';
				PrintOut += CustomerName;
				PrintOut += '&nbsp;&nbsp;&nbsp;';
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Region: </strong>';
                PrintOut += Region;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Zone: </strong>';
                PrintOut += Zone;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Driving Sequence: </strong>';
                PrintOut += Driving_Sequence;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Account Owner: </strong>';
                PrintOut += OwnerID;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Phone: </strong>';
                PrintOut += Phone;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Type: </strong>';
                PrintOut += Type;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Current Season Sales Goal: </strong>$';
                PrintOut += CurrentSeasonSalesGoal.format();
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Current Season Total Orders: </strong>$';
                PrintOut += Current_Season_Total_Orders.format();
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Last Season Sales: </strong>$';
                PrintOut += Last_Season_Sales.format();
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Industry: </strong>';
                PrintOut += Industry;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Total Sales 2 Years Ago: </strong>$';
                PrintOut += Total_Sales_2_Years_Ago.format();
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Account Owner Full Name: </strong>';
                PrintOut += Account_Owner_Full_Name;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Sales Profile: </strong>';
  				PrintOut += Sales_Profile;			    
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Equip Ordering Process: </strong>';
                PrintOut += Equip_Ordering_Process;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Buys from Primary: </strong>';
                PrintOut += Buys_from_Primary;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Buys from Secondary: </strong>';
                PrintOut += Buys_from_Secondary;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Chemical Reps: </strong>';
                PrintOut += Chemical_Reps;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Small Parts Suppliers: </strong>';
                PrintOut += Small_Parts_Suppliers;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Number of Pumps in Service: </strong>';
                PrintOut += Current_Pumps_in_Service;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Current Meters Used: </strong>';
                PrintOut += Current_Meters_Used;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Dura Brand Awareness: </strong>';
                PrintOut += Dura_Brand_Awareness;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Resicore User: </strong>';
                PrintOut += Resicore_User;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Custom Application Services: </strong>';
                PrintOut += Custom_Application_Services;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Number of Tender Trailers Used: </strong>';
                PrintOut += Number_of_Tender_Trailers_Used;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Fertilizer Impregnation: </strong>';
                PrintOut += Fertilizer_Impregnation;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Seed Treatment: </strong>';
                PrintOut += Seed_Treatment;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Regional Mgr Contact Info: </strong>';
                PrintOut += Regional_Mgr_Contact_Info;
              	PrintOut +=  RMCITrueFalse;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>Fiscal Year: </strong>';
                PrintOut += Fiscal_Year;
                PrintOut += '<br/>';
                PrintOut += '<br/>';
                PrintOut += '<strong>A/C Profile Notes: </strong>';
                PrintOut += A_C_Profile_Notes;
   				PrintOut += '<br/>';
				PrintOut += '<br/>';
				PrintOut += '</div>';
			}
		}
    }    
}

 
Cameron HouserCameron Houser
For those you find this later. The problem was I was not passing in the parameter for the If statement. Here is the solution: 
@IsTest
public class CustomerInfoSheetTest 
{
	static testMethod void testCustomerInfoSheet() 
	{
		Account acct = new Account();
		acct.Name='TestAccount';                 
		acct.Industry = 'AG';
		insert acct;
		system.debug('account inserted '+acct.Id);
		

		Test.StartTest();	


			PageReference pageRef = Page.customerinfosheet; 
			pageRef.getParameters().put('id', String.valueOf(acct.Id));
			pageRef.getParameters().put('l', 'a');
			Test.setCurrentPage(pageRef);

			CustomerInfoSheet ac = new CustomerInfoSheet();
        system.debug('CustomerInfoSheet:'+ac);

		Test.StopTest();
	}    
}
This was selected as the best answer