Search in sources :

Example 1 with GlobalVariableDoc

use of org.ballerinalang.docgen.model.GlobalVariableDoc in project ballerina by ballerina-lang.

the class HtmlDocTest method testGlobalVariablePropertiesExtracted.

@Test(description = "Global variables should be available via construct")
public void testGlobalVariablePropertiesExtracted() throws Exception {
    BLangPackage bLangPackage = createPackage("package x.y; " + "@Description { value:\"The Read Append access mode\"}\n" + "public const string RA = \"RA\";");
    GlobalVariableDoc globalVariableDoc = Generator.createDocForNode(bLangPackage.getGlobalVariables().get(0));
    Assert.assertEquals(globalVariableDoc.name, "RA", "Global variable name should be extracted");
    Assert.assertEquals(globalVariableDoc.dataType, "string", "Global variable type should be extracted");
    Assert.assertEquals(globalVariableDoc.description, "The Read Append access mode", "Description of the " + "global variable should be extracted");
}
Also used : BLangPackage(org.wso2.ballerinalang.compiler.tree.BLangPackage) GlobalVariableDoc(org.ballerinalang.docgen.model.GlobalVariableDoc) Test(org.testng.annotations.Test)

Aggregations

GlobalVariableDoc (org.ballerinalang.docgen.model.GlobalVariableDoc)1 Test (org.testng.annotations.Test)1 BLangPackage (org.wso2.ballerinalang.compiler.tree.BLangPackage)1