These methods have been defined for years and generally work this way in Java and other unit testing frameworks too. Further, at this point, it would be a backwards compatibility issue.
I would actually recommend though that you look at the hamcrest assertions if you are just coming to flexunit. they are very powerful and flexibile.
Ah, ok – I was planning on using hamcrest assertions... I was just curious why such a strange naming convention would be followed.
You mention breaking backwards compatibility... But hasn't the 'Assert' class just been introduced?
1 person found this helpful
Nope. The Assert class was always there, it was just used differently. In previous versions of both FlexUnit and Fluint the TestCase extended from Assert so you could use these static methods without the static class name if you wanted. However, it was always an option to do so. This means people were used to saying assertTrue altough they were actually saying Assert.assertTrue(). The new syntax is just because we no longer need to inherit from a base class.
One of the reasons I mention hamcrest is that there is a top-level function for assertThat() so, after the import, you can say assertThat() in your code without the need to prefix it. We just don't want to do this for all of the older style assertions.
Ah, I didn't realize that. Thanks!
And, yes – I do like the look of Hamcrest, and plan on using it.