aboutsummaryrefslogtreecommitdiff
path: root/pkg/tests/testthat/test_PEC_soil.R
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tests/testthat/test_PEC_soil.R')
-rw-r--r--pkg/tests/testthat/test_PEC_soil.R13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/tests/testthat/test_PEC_soil.R b/pkg/tests/testthat/test_PEC_soil.R
new file mode 100644
index 0000000..27b2eb7
--- /dev/null
+++ b/pkg/tests/testthat/test_PEC_soil.R
@@ -0,0 +1,13 @@
+library(pfm)
+context("Simple PEC soil calculations")
+
+test_that("PEC_soil calculates correctly", {
+ # Application of 100 g/ha gives 0.133 mg/kg under default assumptions
+ expect_equal(PEC_soil(100), 0.1 * 4/3)
+
+ # or 0.1 mg/kg assuming 25% interception
+ expect_equal(PEC_soil(100, interception = 0.25), 0.1)
+
+ # Mixing depth of 1 cm gives five-fold PEC
+ expect_equal(PEC_soil(100, interception = 0.25, mixing_depth = 1), 0.5)
+})

Contact - Imprint