@ -504,6 +506,48 @@ public class TitleParserTest extends DatabaseTestCase {
//----------------Repeats end----------------//
//----------------Tags begin----------------//
/** tests all words using priority 0 */
publicvoidtestTagsPound()throwsException{
String[]acceptedStrings={
"#tag",
"#a",
"#(a cool tag)",
"#(cool)"
};
TaskServicetaskService=newTaskService();
Tasktask=newTask();
for(StringacceptedString:acceptedStrings){
task=newTask();
task.setValue(Task.TITLE,"Jog "+acceptedString);//test at end of task. should set importance.
ArrayList<String>tags=newArrayList<String>();
TitleParser.listHelper(task,tags);
assertTrue("test pound at failed for string: "+acceptedString+" for tags: "+tags.toString(),tags.contains(TitleParser.trimParenthesis(acceptedString)));
}
}
/** tests all words using priority 0 */
publicvoidtestTagsAt()throwsException{
String[]acceptedStrings={
"@tag",
"@a",
"@(a cool tag)",
"@(cool)"
};
TaskServicetaskService=newTaskService();
Tasktask=newTask();
for(StringacceptedString:acceptedStrings){
task=newTask();
task.setValue(Task.TITLE,"Jog "+acceptedString);//test at end of task. should set importance.
ArrayList<String>tags=newArrayList<String>();
TitleParser.listHelper(task,tags);
assertTrue("testTagsAt failed for string: "+acceptedString+" for tags: "+tags.toString(),tags.contains(TitleParser.trimParenthesis(acceptedString)));