1
0
Răsfoiți Sursa

A template/snippet for a single test

netuttki 1 an în urmă
părinte
comite
20d3da2ee1
1 a modificat fișierele cu 35 adăugiri și 0 ștergeri
  1. 35 0
      test/test_template_snippet

+ 35 - 0
test/test_template_snippet

@@ -0,0 +1,35 @@
+if $ARGS[0] = 'test_functionname_variant':
+    $TESTNAME = 'descriptive_testname'
+    $FUNCTIONNAME = 'functionname'
+
+    if _ISVALIDCALL['<<$LOCATIONNAME>>,<<$FUNCTIONNAME>>'] ! 0:
+        gs 'testframework', 'testsetup'
+        $EXPECTED = 'expected_value'
+        $EXPECTED_MESSAGE = "variable_holding_actual_value = <<$EXPECTED>>"
+        $ARGUMENTS = ''
+        gs $LOCATIONNAME, $FUNCTIONNAME
+        *clr & cla 
+        $ACTUAL = variable_holding_actual_value
+        $ACTUAL_MESSAGE = "variable_holding_actual_value = '<<$ACTUAL>>'"
+  
+        TESTRESULT = $EXPECTED = $ACTUAL
+  
+    else
+        $ACTUAL_MESSAGE = '<<$LOCATIONNAME>> <<$FUNCTIONNAME>> does not exist.'
+    end
+  
+    !! ------------------------------------------------------------------------------------
+    !! Add testresult to the reports.
+    !! ------------------------------------------------------------------------------------
+  
+    gs 'testframework', 'addTestResult'
+    
+    !! ------------------------------------------------------------------------------------
+    !! Clean up the variables for the next test.
+    !! ------------------------------------------------------------------------------------
+   
+    gs 'testframework', 'testCleanUpDefault'
+    !! add cleanup for any variables that you used for the test. For example, the variable that
+    !! provided the ACTUAL value or the variables that were set for the tested code.
+  
+end