Skip to content

Commit

Permalink
#17 increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
hudde committed Nov 3, 2023
1 parent 3ac1537 commit af61504
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/testthat/test-Malliavin_Asian_Greeks.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand All @@ -107,6 +109,7 @@ test_that("Malliavin_Asian_Greeks is correct", {
dividend_yield = dividend_yield,
payoff = payoff,
greek = greek,
model = model,
antithetic = TRUE
)

Expand All @@ -123,6 +126,7 @@ test_that("Malliavin_Asian_Greeks is correct", {
dividend_yield = dividend_yield,
payoff = payoff,
greek = start,
model = model,
antithetic = TRUE
)
}
Expand Down

0 comments on commit af61504

Please sign in to comment.