Skip to content

Commit 33bdef0

Browse files
committed
Add Test class
1 parent e5d48f8 commit 33bdef0

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@isTest
2+
public with sharing class RelatedList_Test {
3+
@IsTest
4+
static void getRecords_Test(){
5+
6+
Test.startTest();
7+
User testUser = [Select id from user where id = :UserInfo.getUserId()];
8+
System.runAs(testUser){
9+
RelatedList.getRecords('Select id from contact limit 10');
10+
}
11+
Test.stopTest();
12+
13+
}
14+
15+
@IsTest
16+
static void countRecords_Test(){
17+
User testUser = [Select id from user where id = :UserInfo.getUserId()];
18+
Test.startTest();
19+
System.runAs(testUser){
20+
RelatedList.countRecords('Contact');
21+
RelatedList.countRecords(null);
22+
}
23+
Test.stopTest();
24+
25+
}
26+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<apiVersion>48.0</apiVersion>
4+
<status>Active</status>
5+
</ApexClass>

0 commit comments

Comments
 (0)