Skip to content

Commit 4c00247

Browse files
committed
add tests for npr()
1 parent b711532 commit 4c00247

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/testthat/test-npr.R

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Test nums per recruit function
2+
test_that("NPR produces a list", {
3+
xx <- npr(S0 = .91, S1plus = .99, nages = 10, AgeMat = 8)
4+
expect_type(object = xx, type = "list")
5+
})
6+
7+
test_that("One-plus nums per recruit is greater than reproducing nums per recruit", {
8+
xx <- npr(S0 = .91, S1plus = .99, nages = 10, AgeMat = 8)
9+
expect_true(xx$P1r > xx$npr)
10+
})

0 commit comments

Comments
 (0)