-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathApexClassDbTest.cs
More file actions
62 lines (50 loc) · 1.78 KB
/
Copy pathApexClassDbTest.cs
File metadata and controls
62 lines (50 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using NUnit.Framework;
namespace ApexSharpDemo.Data
{
[TestFixture]
public class ApexClassDbTest
{
private readonly ApexClassDb db;
public ApexClassDbTest()
{
db = new ApexClassDb();
}
[Test]
public void NameSpaceTest()
{
Assert.AreEqual("System", db.GetCorrectNameSpace("system"));
Assert.IsNull(db.GetCorrectNameSpace("systemWrong"));
}
[Test]
public void ClassNameNoNameSpaceTest()
{
Assert.AreEqual("System", db.GetCorrectClassName("", "system"));
}
[Test]
public void ClassNameTest()
{
Assert.AreEqual("System", db.GetCorrectClassName("system","system"));
Assert.IsNull(db.GetCorrectClassName("system","systemWrong"));
}
[Test]
public void MethodNameTest()
{
Assert.AreEqual("debug", db.GetCorrectMethodName("system","system","DEBUG"));
Assert.IsNull(db.GetCorrectMethodName("system","system","DEBUGWrong"));
}
[Test]
public void ValidateApexMethodTest()
{
// ConnectApi.Zones.setTestSearchInZone(String communityId, String zoneId, String q, ConnectApi.ZoneSearchResultType filter, String pageParam, Integer pageSize, ConnectApi.ZoneSearchPage result)
var methodDto = new ApexMethodDto
{
NameSpace = "ConnectApi",
ClassName = "Zones",
MethodName = "setTestSearchInZone",
ParameterList = "String:String:String:ConnectApi.ZoneSearchResultType:String:Integer:ConnectApi.ZoneSearchPage"
};
methodDto = db.ValidateApexMethod(methodDto);
Assert.NotNull(methodDto);
}
}
}