Now I'm making Apex test case for clearing code-coverage.
Used normal code following like,
TestDataFactory
@isTest
public class TestDataFactory{
public List<Account> createAccounts(){
// data create...
return accounts;
}
// data create methods...
.
.
.
}
MyTestClass
@isTest
private class MyTestClass {
static testmethod void test1() {
TestDataFactory.createAccounts();
// Run some tests
}
// other testmethods
.
.
.
}
Number of lines of my TestDataFactory class is 100lines, and MyTestClass 100lines is test case logic is already completed code cover.
Therefore, 100 lines / 200 lines. Code coverage is 50%.
Because code coverage of TestDataFactory class is 0%.
How can I solve it?
I'm sorry for poor English. Thank you for reading it.
Aucun commentaire:
Enregistrer un commentaire