| Issue 6: | Assert.cfc needs work | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Essentially, Assert.cfc needs refactoring. There's a fair amount of effort required here. I think if we can make it look as close to JUnit's Assert, that would be the way to go. There are a number of CFMX related extensions that we may want to keep or extend differently; e.g., to a sub class of Assert ...
Aug 7, 2007
Project Member
#1
virtix
Aug 21, 2007
Uploaded better version. There's still work needed but we're getting closer. assertEquals() and assertTrue() work closely to JUnit.
Sep 15, 2007
Just to remember concept for comparing CFCs. Since toString() does not work on CFCs, we can offer this: if there is a user-defined stringValue() method in the CFC, which would return a string representation of the CFC, we can invoke that on each of the objects being compared in order to compare their relative "value", otherwise Assert.equals() would default to the .equals() behavior, which would, as in Java, compare whether or the CFCs are the same not that they have the same values.
Sep 22, 2007
Updated Assert so that it compares CFCs and other complex objects as long as there is a string representation of that object. toString() works for arrays, structs, and queries, but not CFCs. So, if the developer has implemented a stringValue() method, that is used to compare CFC values. But if none is provided, the equality test will return false as there is no readilly apparent way to test CFC instances. We probably will look for some value such as cfcInstanceId or some such to determine this. This can be accomplished by the developer by adding this Id at runtime in the implicit or explicit contstructors OR by overriding the WEB-INF/component.cfc file whereby the id will then be stored in all CFC instances.
Status:
Started
Labels: -Priority-Medium Priority-High
Oct 6, 2007
Still need to update the othe methods to accept the message parameter as the first argument,
Status:
In
Dec 14, 2007
Lots of work here. We did setTestStyle() to select either message first or last or optional and refactored to only have assertTrue/Equals/False ... others are extenstions and can be added via the addAssertionDecorator(s) ...
Status:
Fixed
|