Details
-
Type:
Wish
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Assert
-
Labels:None
-
Number of attachments :
Description
Hello,
in the last days I tried a lot of things with FEST and for my own tests I wrote some useful classes and I think it could be useful to have them in FEST for all users. The idea was to have an assert-method that expects an exception when calling the given method.
And then I thought I could use the method in my JTreeFixture for example to ensure that a given row doesn't exist. This maybe a crazy way to test this, but I wanted to use my method ![]()
I attached the classes that I would need to define a new assert-method. Feel free to use the code or not to ..
I would add this method to Assertions:
public static ExceptionalMethod assertThat(Invoker<Void> i)
{ return new ExceptionalMethod(i); }The method I would add into JTreeFixture would look like:
public JTreeFixture ensureRowDoesntExist(int row) throws IllegalArgumentException, SecurityException
{ Assertion.assertThat(Reflection.method("selectRow").withParameterTypes(int.class).in(this)).whithParameters(row) .willThrow(IndexOutOfBoundsException.class); return this; }Thanks!