From af61504fae7b2f89155cdea61d632e5a9c4837a6 Mon Sep 17 00:00:00 2001 From: hudde Date: Fri, 3 Nov 2023 18:50:46 +0100 Subject: [PATCH] #17 increase test coverage --- tests/testthat/test-Malliavin_Asian_Greeks.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/testthat/test-Malliavin_Asian_Greeks.R b/tests/testthat/test-Malliavin_Asian_Greeks.R index 08e08e7..453de6b 100644 --- a/tests/testthat/test-Malliavin_Asian_Greeks.R +++ b/tests/testthat/test-Malliavin_Asian_Greeks.R @@ -85,6 +85,7 @@ test_that("Malliavin_Asian_Greeks is correct", { for(i in 1:number_of_runs) { # the parameters are chosen at random + model <- sample(c("black_scholes", "jump_diffusion"), 1) initial_price <- runif(1, 90, 110) exercise_price <- runif(1, 90, 110) r <- runif(1, -0.01, 0.1) @@ -96,6 +97,7 @@ test_that("Malliavin_Asian_Greeks is correct", { greek <- "delta" param <- "initial_price" start <- "fair_value" + model <- sample(c("black_scholes", "jump_diffusion"), 1) Vals <- Malliavin_Asian_Greeks( @@ -107,6 +109,7 @@ test_that("Malliavin_Asian_Greeks is correct", { dividend_yield = dividend_yield, payoff = payoff, greek = greek, + model = model, antithetic = TRUE ) @@ -123,6 +126,7 @@ test_that("Malliavin_Asian_Greeks is correct", { dividend_yield = dividend_yield, payoff = payoff, greek = start, + model = model, antithetic = TRUE ) }