Ticket Created
over 3 years ago

WERETECH-12587

Test methods is(), isnt() and ok()

I think it is nice to have some easier, less typing test method function names:

* Test.assertEqualMessage() as is()
* Test.assertNotEqualMessage() as isnt()
* Test.assertMessage() as ok()

This would allow way less typing, eg:

Test.is(needle, haystack, "Needle found in the haystack");
Test.isnt(needle, haystack, "Nope");
Test.ok(error instanceof Lang.ValueOutOfBoundsException, "Correct error is thrown");

Parents
  • I have seen many testing frameworks. Is there some precedent for using the names is, isnt and ok? The names we are using now are loosely based on the functionality of JUnit. I do agree we could add functionality (assertTrue, assertFalse, assertNotEquals, assertNull, assertNotNull, assertSame, assertNotSame, ...) to make Test more useful, but I don't really see that these new names buy us anything.

    If you're just trying to reduce typing, why not take advantage of the autocomplete feature of the vscode?

Comment
  • I have seen many testing frameworks. Is there some precedent for using the names is, isnt and ok? The names we are using now are loosely based on the functionality of JUnit. I do agree we could add functionality (assertTrue, assertFalse, assertNotEquals, assertNull, assertNotNull, assertSame, assertNotSame, ...) to make Test more useful, but I don't really see that these new names buy us anything.

    If you're just trying to reduce typing, why not take advantage of the autocomplete feature of the vscode?

Children
No Data