Skip to content

Commit

Permalink
Merge pull request #566 from baptischmi/testthat-data
Browse files Browse the repository at this point in the history
Update test-data.R
  • Loading branch information
iskandari authored May 25, 2023
2 parents c2c54a9 + afca908 commit a390c38
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/testthat/test-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,42 @@ test_that("Example objects are of the correct class", {
expect_s3_class(example_vp, "vp")
expect_s3_class(example_vpts, "vpts")
})

test_that("Example objects are of correct class (2nd test)", {
expect_true(is.scan(example_scan))
expect_true(is.vp(example_vp))
expect_true(is.vpts(example_vpts))
})

test_that("Example scan includes all five parameters", {
expect_true(is.param(get_param(example_scan, 'DBZH')))
expect_true(is.param(get_param(example_scan, 'VRADH')))
expect_true(is.param(get_param(example_scan, 'RHOHV')))
expect_true(is.param(get_param(example_scan, 'ZDR')))
expect_true(is.param(get_param(example_scan, 'PHIDP')))
})

test_that("Plotting example scan produces no error", {
expect_no_error(plot(example_scan, param = "DBZH"))
expect_no_error(plot(example_scan, param = "VRADH"))
expect_no_error(plot(example_scan, param = "RHOHV"))
expect_no_error(plot(example_scan, param = "ZDR"))
expect_no_error(plot(example_scan, param = "PHIDP"))
})

test_that("Plotting example vp produces no error", {
expect_no_error(plot(example_vp, quantity = "DBZH"))
expect_no_error(plot(example_vp, quantity = "dbz"))
expect_no_error(plot(example_vp, quantity = "eta"))
expect_no_error(plot(example_vp, quantity = "dens"))
})

test_that("Plotting example vpts produces no error", {
expect_no_error(plot(regularize_vpts(example_vpts), quantity = "DBZH"))
expect_no_error(plot(regularize_vpts(example_vpts), quantity = "dbz"))
expect_no_error(plot(regularize_vpts(example_vpts), quantity = "eta"))
expect_no_error(plot(regularize_vpts(example_vpts), quantity = "dens"))
})



0 comments on commit a390c38

Please sign in to comment.