Learn R Programming

RTest (version 1.2.6)

setTestMethod: Create and Save a Default Test Method For a Test Case Adapter

Description

This function creates and saves a default test method for a RTest adapter with predefined arguments (see 'Details'). It will automatically create the generic as well as the method for the test case class using S4 style.

Usage

setTestMethod(f, signature = "RTestCase", definition = function(object,
  inputData, execCache, xmlDef, ...) NULL, where = parent.frame())

Arguments

f

(character) The name of the function.

signature

(character) The name of the corresponding test case adapter (i.e. the name of the class, which inherits 'RTestCase' and implements all functions associated to a test case type and specifications).

definition

(function) The method, which will be called if the signature matches the definitions (see 'Details').

where

(env) An environment where to set up the Method

Details

This function is a wrapper for standardized and simplified creation of S4-syle test case adapters required for RTest. The passed function has to be assigned to the corresponding test case class, whichinherits RTestCollection-class) and represents the adapter for the respecive implementation of a test case type (i.e. XSD scheme). The passed function definition has to be in the following format with the following parameters. function(object, inputData, execCache, xmlDef, ... ) { # implementation goes here }

  • object(object) The RTestCase-class object.

  • inputData(list) List with all input data provided in the XML test case.

  • execCache(list) List with cached results determined in the predecessor test functions of a test case execution.

  • xmlDef(XMLNode) An object of class XMLNode, which defines the current test function.

  • ...Additional parameters passed to the individual test functions.

See Also

setGeneric, setMethod