You need to sign in to do that
Don't have an account?
Getting Error On test Class
- public class ControllerFeedback {
- public alu_Opportunity_Matching__c objs {get;set;}
- public void init() {
- Id ids = ApexPages.currentPage().getParameters().get('id');
- system.debug('Id'+ids);
- alu_Opportunity_Matching__c obj = [select id, Applicant_Student_Record__r.Name, Application_Status__c,Opportunity__r.Name FROM alu_Opportunity_Matching__c WHERE id = :ids];
- objs = obj;
- system.debug('name'+objs);
- obj.Application_Status__c = 'Opted-out';
- Update obj;
- return;
- }
- }
- @isTest
- public class ControllerFeedbackTests {
- static testMethod void test_ControllerFeedback() {
- test.startTest();
- account acc = new account();
- acc.Name = 'test';
- insert acc;
- Contact con = new Contact();
- con.Lastname = 'test con';
- con.Email = 'test@gmail.com';
- con.AccountId = acc.Id;
- insert con;
- Opportunity opp = new Opportunity();
- opp.AccountId = acc.Id;
- opp.Name = 'Demo';
- opp.StageName = 'Demo';
- opp.CloseDate = System.Today();
- opp.Key_Contact__c = con.Id;
- insert opp;
- alu_Opportunity_Matching__c aluOpp = new alu_Opportunity_Matching__c();
- aluOpp.Applicant_Student_Record__c = opp.Key_Contact__c;
- aluOpp.Opportunity__c = opp.Id;
- aluOpp.Application_Status__c = 'none';
- insert aluOpp;
- PageReference testPage = new pagereference('/apex/feedback');
- ApexPages.currentPage().getParameters().put( 'id', aluOpp.id );
- ControllerFeedback cf = new ControllerFeedback();
- cf.init();
- test.stopTest();
- }
- }
Hi Sumit,
Could you please just post an error message so this will help me to resolved the error.