|
[Previous]  [Next] 
|
![]() |
User Manual [Previous]  [Next] Basic TestcaseTestcase can be embed within the Umple model and will be generated when using the Test generator. A testcase can be embedded at the class-level or the model-level.
A testcase canonsists of the following elements: Initialization: ~identidier ~name = ~value;
Example
class Student {
id = "ID123";
name = "John";
test checkSetId {
Student s ();
assertTrue(s1.setId("ID432"));
}
}
Load the above code into UmpleOnline Another Example
class Student {
id;
name;
test checkSetId {
Student s ("98CS","Jane");
assertEqual(s.getId(),"98CS");
s.setName("Roger");
assertFalse(s.getName() == "Jane");
}
}
Load the above code into UmpleOnline |