Browse Source

A template/snippet for a single test

netuttki 10 months ago
parent
commit
20d3da2ee1
1 changed files with 35 additions and 0 deletions
  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