You need to sign in to do that
Don't have an account?
srikanth11
test case help
this is the clas i have written some one help me how to write the test case
public with sharing class files1 { public files1() { s1=new file__c(); s2=new file__c(); s3=new file__c(); s4=new file__c(); s4=new file__c(); s5=new file__c(); } public files1(ApexPages.StandardController controller) { } public file__c s1 {get; set;} public file__c s2 {get; set;} public file__c s3 {get; set;} public file__c s4 {get; set;} public file__c s5 {get; set;} public PageReference saveall() { insert s1; insert s2; insert s3; insert s4; insert s5; return null; } }
Hi,
You can try below code
Use this public with sharing class files1
{
public files1()
{
s1=new file__c();
s2=new file__c();
s3=new file__c();
s4=new file__c();
s4=new file__c();
s5=new file__c();
}
public files1(ApexPages.StandardController controller)
{
}
public file__c s1 {get; set;}
public file__c s2{get; set;}
public file__c s3{get; set;}
public file__c s4{get; set;}
public file__c s5{get; set;}
public PageReference saveall()
{
insert s1;
insert s2;
insert s3;
insert s4;
insert s5;
return null;
}
static testMethod void myTest()
{
files1 f=new files1();
f.saveall();
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
All Answers
Hi,
You can try below code
Use this public with sharing class files1
{
public files1()
{
s1=new file__c();
s2=new file__c();
s3=new file__c();
s4=new file__c();
s4=new file__c();
s5=new file__c();
}
public files1(ApexPages.StandardController controller)
{
}
public file__c s1 {get; set;}
public file__c s2{get; set;}
public file__c s3{get; set;}
public file__c s4{get; set;}
public file__c s5{get; set;}
public PageReference saveall()
{
insert s1;
insert s2;
insert s3;
insert s4;
insert s5;
return null;
}
static testMethod void myTest()
{
files1 f=new files1();
f.saveall();
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
great help u rock jain