[utest] r25 committed - Created wiki page through web user interface.

0 views
Skip to first unread message

codesite...@google.com

unread,
Aug 7, 2009, 5:28:40 AM8/7/09
to utes...@googlegroups.com
Revision: 25
Author: franco.ponticelli
Date: Fri Aug 7 02:28:07 2009
Log: Created wiki page through web user interface.
http://code.google.com/p/utest/source/detail?r=25

Added:
/wiki
/wiki/BasicTutorial.wiki

=======================================
--- /dev/null
+++ /wiki/BasicTutorial.wiki Fri Aug 7 02:28:07 2009
@@ -0,0 +1,41 @@
+#summary How to write your first Test
+
+= Introduction =
+
+In this small example a class Test contains the logic of the test itself
(testMath) and the test execution (code in main).
+Every test fixture (method that includes one or more assertion) must be
prefixed with the lower cased word "test". You can add two special
functions "setup" and "tearDown" that will be executed just before and
after each test method. They are used to prepare and clean-up the tests
environment.
+Assertions are made accessing the static methods of the Assert class.
+
+
+= Details =
+
+Test.hx
+{{{
+import utest.Assert;
+import utest.Runner;
+import utest.ui.text.TraceReport;
+
+class Test {
+ public static function main() {
+ var runner = new Runner();
+ runner.addCase(new Test());
+ var report = new TraceReport(runner);
+ runner.run();
+ }
+
+ public function new();
+
+ public function testMath() {
+ Assert.equals(1+1, 2);
+ }
+}
+}}}
+
+build.hxml
+{{{
+-main Test
+-lib utest
+-swf test.swf
+}}}
+
+The build script assumes that you have installed utest using the
command "haxelib install utest". If you are using the SVN version just
point to the correct path using the -cp switch.

Reply all
Reply to author
Forward
0 new messages