UnitTester: Constructor of the class UnitTester

Description Usage Arguments Value Examples

View source: R/UnitTester.R

Description

Constructor of the class UnitTester

Usage

1
UnitTester(turnWarningsToErrors = TRUE, hidePassed = FALSE)

Arguments

turnWarningsToErrors

If set to TRUE, all warnings issued within any test method are turned into errors. The default value is TRUE.

hidePassed

If set to TRUE, all passed test results are hidden in the output. The is useful when you are only interested in the failed assertions and the unexpected errors. The default value is FALSE.

Value

an instance of UnitTester

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
unitTester <- UnitTester()

unitTester$addTest('Test 1', function() {
  unitTester$assertEqual(1, 1)
})

unitTester$addTest('Test 2', function() {
  unitTester$assertThrow(function() {
    stop('Error from Test 2')
  })
})

unitTester$runAllTests()

cartowong/oo documentation built on May 21, 2019, 2:21 p.m.