tests/testthat/test-hotel_emissions.R

test_that("calculations are correct when you edit options on hotel emissions", {
  expect_equal(4*hotel_emissions(location = "UK"), hotel_emissions(location = "UK", nights = 4))
  expect_equal(16*hotel_emissions(location = "UK"), hotel_emissions(location = "UK", nights = 4, rooms = 4))
})

test_that("error function for incorrect locations", {
  expect_error(hotel_emissions(location = "uk"))
})
lilyclements/caRbon documentation built on April 17, 2025, 6:10 p.m.