tests/testthat/test-summarize_stat.R

#test 1
test_that("Class of 'dataset' should be dataframe", {
  expect_error(summarize_stat('apt_buildings', property_type, year_built)) })
#test 2
test_that("Class of 'column' should be numeric", {
  expect_error(summarize_stat(datateachr::apt_buildings, property_type, air_conditioning)) })
#test 3
test_that("Class of output should be dataframe", {
  Func <- summarize_stat(datateachr::apt_buildings, property_type, year_built)
  expect_true(is.data.frame(Func))
})
stat545ubc-2021/functions-Yixuan-L documentation built on Dec. 23, 2021, 5:25 a.m.