tests/testthat/test-define_dimension.R

context("test define_dimension")

test_that("define_dimension works", {
  sd <- dimensional_model()
  sd <- define_dimension(sd,
                         name = "when",
                         attributes = c("Week Ending Date",
                                        "WEEK",
                                        "Year"))
  sd <- define_dimension(
    sd,
    name = "when_available",
    attributes = c(
      "Data Availability Date",
      "Data Availability Week",
      "Data Availability Year"
    )
  )
  sd <- define_dimension(sd,
                         name = "where",
                         attributes = c("REGION",
                                        "State",
                                        "City"))
  sd <- define_dimension(sd, name = "who",
                         attributes = c("Age Range"))
  expect_equal(sd$dimension, dm_mrs_age$dimension)
})

Try the starschemar package in your browser

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

starschemar documentation built on Nov. 11, 2023, 5:09 p.m.