!3 Value Object parses Strings itself
* As a value object class, in Java the underlying class ''!-MyPoint-!'' has a method:
* ''public static !-MyPoint-! parse(String)''
* This method is used twice in the first table, to parse (and create) both the value for the argument and the ''expected'' value.
* It's used once in the second table, to create the argument.
* In Java, the ''!-MyPoint-!'' class also needs an ''equals()'' method to compare the ''expected'' and ''actual'' values.
* This is used in the first two tables
* In Java, the ''!-MyPoint-!'' class also needs a ''toString()'' method to show itself when there is an error
* This is shown in the second table, where the ''expected'' and the ''actual'' value of the point differ, and so the ''actual value'' needs to be displayed
* If the type of the result of a method call is a value object, it will not be auto-wrapped with a ''!-DomainObjectCheckTraverse-!''.
* That's so that it can be '''check'''ed in workflow, which is usually what's required
* So we need to explicitly wrap it in the code if we want to check its properties.
* This is shown in the third table
* Similar methods will be required with other programming languages. See the appropriate documentation.
!**< def
!define test {!|fitlibrary.specify.valueObject.ParseMyPoint|
|'''check'''|a point|(12,34)|(12,34)|
|'''check'''|a point|(12,34)|(0,0)|
|''a point as domain object''|(12,34)|
|x|12|
|y|34|
}
**!
|!-fitlibrary.spec.SpecifyFixture-!|
|${test}|!-
fitlibrary.specify.valueObject.ParseMyPoint |
check |
a point |
(12,34) |
(12,34) |
check |
a point |
(12,34) |
(0,0) expected (12,34) actual |
a point as domain object |
(12,34) |
x |
12 |
y |
34 |
-!|