Hi,
Please refer to my previous posts to know the details about the following:
Model: DaxologyTest
Project: CG_UnitTestCases
In this post, I will create a test method in the class CGSampleDataTest by name IdExistsTest that checks whether a record with Id value as "1" exists or not in SampleTable by confining to execute in company by name DAX with the help of property SysTestCaseDataDependency.
Step 1: In the class declaration set the class to extend SysTestCase class and set the attribute SysTestCaseDataDependency to company DAX.
[SysTestCaseDataDependency("DAX")]class CGSampleDataTest extends SysTestCase
[SysTestCaseDataDependency("DAX")]
class CGSampleDataTest extends SysTestCase
{
[SysTestMethod]
public void IdExistsTest()
{
SampleTable sampleTable;
boolean idExists;
int id = 1;
select firstonly RecId
from sampleTable
where sampleTable.Id == int2Str(id);
idExists = (sampleTable.RecId) ? (true) : (false);
this.assertTrue((idExists == true), strFmt("Record with value of Id as %1 exists in Sample Table", id));
}
}
Step 5: Executed the test method and had the test result as passed.
Regards,
Chaitanya Golla

Like
Report
*This post is locked for comments