+ Start a Discussion
sales force 48sales force 48 

test class issue when i pass account id in visualforce

Hi Guys,

I have custom button on account called "registration"
and when i click that button  it call extension controller which has written on account object  developed visualforce page appears for the lead registration 
the url looks like (https://c.cs17.visual.force.com/apex/ManualRegistration?id=001g000000ZNN4G)

and my custom button javascript code is as below

if("{!Account.companyname__c}" == "xxx")

but the issue here is that when i write a test class to that particulat visualforce controller
it shows an error is that list has no rows on Sobject

my test class is below

public class ManualRegistrationTest
    public static testMethod void InsertLeadMethodforindividual()
        Account acc=new account();
        insert acc;
        Test.setCurrentPageReference(new PageReference('Page.ManualRegistration'));
        System.currentPageReference().getParameters().put('id', acc.Id);
        ApexPages.StandardController stdController = new ApexPages.StandardController(acc);
        ManualRegistration objGenerateJobOfferController = new ManualRegistration(stdController);
can any one please let me know the  solution for it as i am getting 0% code coverage even am trying to write a lot of code
If possibel post your class code .