tests/testthat/test_gaussianfield.R

# nolint start
context("nlm_gaussianfield")

test_that("nlm_gaussianfield behaves like it should", {
  gaussian_field <- nlm_gaussianfield(ncol = 90, nrow = 30,
                                      autocorr_range = 75, mag_var = 0.4)
  expect_that(gaussian_field, is_a("RasterLayer"))
})

test_that("nlm_gaussianfield produces the right number of rows", {
  gaussian_field <- nlm_gaussianfield(ncol = 9, nrow = 12)
  expect_equal(gaussian_field@nrows, 12)
})

test_that("nlm_gaussianfield produces the right number of columns", {
  gaussian_field <- nlm_gaussianfield(ncol = 9, nrow = 12)
  expect_equal(gaussian_field@ncols, 9)
})

# nolint end

Try the NLMR package in your browser

Any scripts or data that you put into this service are public.

NLMR documentation built on Sept. 20, 2021, 9:07 a.m.