You need to sign in to do that
Don't have an account?
Ab
test coverage 0% always
Hello,
I have a simple class and i have writen a test class for it.
Test coverage alwayw shows 0 %,
I dont understand where i am ggoing wrong
I have a simple class and i have writen a test class for it.
Test coverage alwayw shows 0 %,
I dont understand where i am ggoing wrong
public with sharing class test{ public String temp{get;set;} public test(){ temp = ' '; } }
@isTest(seeAllData=true) public class testtest{ static testMethod void tesTttest () { test t= new test (); t.temp = ''; } }
Class
public with sharing class Sample{
public String temp{get;set;}
public Sample(){
temp = ' ';
}
}
Test Class
@isTest(seeAllData=true)
public class testtest{
static testMethod void tesTttest () {
Sample t= new Sample();
t.temp = '';
}
}
Now run your test class it will cover 100%.
You Cannot name any Class with "Test" in salesforce because TestClass will not able to recognise .