tests/testthat/test-sunrise_sunset.R

test_that("sunrise() returns error on incorrect parameters", {

})

test_that("sunset() returns error on incorrect parameters", {

})

test_that("sunrise in the Netherlands", {
  expect_s3_class(
    sunrise("2016-01-01", 5, 53),
    c("POSIXct", "POSIXt")
  )
  expect_true(sunrise("2016-01-01", 5, 53) <
    as.POSIXct("2016-01-01 13:00:00 UTC", tz = "UTC"))
})

test_that("sunset in the Netherlands", {
  expect_s3_class(
    sunset("2016-01-01", 5, 53),
    c("POSIXct", "POSIXt")
  )
  expect_true(sunset("2016-01-01", 5, 53) >
    as.POSIXct("2016-01-01 13:00:00 UTC", tz = "UTC"))
})
adokter/birdRad documentation built on Feb. 1, 2024, 3:40 p.m.