• Barrie Potter
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I would really apprecitate some assitance here getting this test to work right. I am not a developer but I am trying!
Here is my Controller Extension 
public with sharing class ContactSaveEXT {
    ApexPages.StandardController controller;
    public ContactSaveEXT (ApexPages.StandardController controller) {
        this.controller = controller;
    }
    public PageReference doSaveAndRedirect() {
        this.controller.save();
        PageReference redirect = new PageReference('https://c.cs43.visual.force.com/apex/Thankyoupage?core.apexpages.request.devconsole=1');
        return redirect;
    }
}

And here is my test
@isTest
public class ContactSaveExt_Test {
  
    static testmethod void test() 
    {
   //create Account

Account testAccount = new Account();
		testAccount.Name='Test Account' ;
		insert testAccount; 
//Create Contact
Contact con= new contact();
con.Email = 'Test@gmail.com';
con.LastName= 'TodayTest';
con.FirstName= 'Test';
con.Id = con.Id;
insert con;   

//create pageReference
PageReference page = new PageReference('/apex/AdultVolunteerWaiver');
Test.setCurrentPage(page);

//pass parameter to the page
ApexPages.currentPage().getParameters().put('id',con.Id);
ApexPages.currentPage().getParameters().put('FirstName',con.FirstName);
ApexPages.currentPage().getParameters().put('LastName',con.LastName);
ApexPages.currentPage().getParameters().put('Email',con.Email);


//create an instance of controller.
ApexPages.StandardController standrdcontroller = new ApexPages.StandardController(con);  

ContactSaveExt clsInstance = new ContactSaveExt(standrdcontroller);

    }    
}

I get this error: Challenge Not yet complete... here's what's wrong: 
The Suggestion custom object does not contain the correct set of custom fields. Tip: check for typos in the field names.

I've followed all steps, went back and rechecked, and then redid the entire challenge. I can't get it to pass. What am I doing wrong? I have included all custom fields and spelled them correctly.