|
Re: XPECT testing [message #1114808 is a reply to message #1112360] |
Mon, 23 September 2013 08:28 |
Moritz Eysholdt Messages: 161 Registered: July 2009 Location: Kiel, Germany |
Senior Member |
|
|
Hi Arshad,
I recently blogged about Xpect, see: http://blog.moritz.eysholdt.de/2013/09/introduction-to-xpect.html
I'm not completely sure I understand what you have in mind. But here is some sketch, let me know how close it gets to what you imagined:
someName.dsl.xt
// XPECT_SETUP mypackage.MyJavaTest END_SETUP
// XPECT myTestMethod --> Hello Berlin
MyJavaTest.java
package mypackage;
class MyJavaTest {
public void myTestMethod(@StringExpectation IStringExpectation expectation) {
expectation.assertEqual("Hello Kiel")
}
}
If you run this test, the file someName.dsl.xt will invoke the method myTestMethod() from the Java class. The part after the "-->" will passed in as expectation. Consequently, the assertEqual fails because "Hello Berlin" does not equal "Hello Kiel". You can double-click on the failed test to open the comparison editor to compare/edit the failed expectation.
[Updated on: Mon, 23 September 2013 08:32] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01401 seconds