tests/testthat/test-present_value_of_future_risk.R

library(testthat)
library(CNAIM)

context("Present value of Future Risk")

test_that("Regular Case", {

  res <- present_value_future_risk(c(0.1, 0.2, 0.5), 100) %>% round(2)
  expected_val <- 73.43

  expect_equal(res, expected_val)
})

Try the CNAIM package in your browser

Any scripts or data that you put into this service are public.

CNAIM documentation built on Aug. 31, 2022, 9:13 a.m.