# agridatasets - A Comprehensive Collection of Agricultural and Agronomic Datasets
# Version 0.1.1
# Copyright (C) 2026 Renzo Caceres Rossi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

# cows_insemination

library(testthat)

# Test 1: Check that the object is a data.frame and has 7 columns
test_that("cows_insemination is a data.frame with 7 columns", {
  expect_s3_class(cows_insemination, "data.frame")
  expect_equal(ncol(cows_insemination), 7)
  expect_equal(length(cows_insemination), 7)
})

# Test 2: Check the number of rows
test_that("cows_insemination has 10 rows", {
  expect_equal(nrow(cows_insemination), 10)
})

# Test 3: Validate column names
test_that("cows_insemination has correct column names", {
  expect_named(
    cows_insemination,
    c("Time", "Sillod_Insemination_C1", "Sillod_Conception_C1",
      "Sillod_Insemination_C2", "Sillod_Conception_C2",
      "Sillod_Insemination_C3", "Sillod_Conception_C3")
  )
})

# Test 4: Check data types
test_that("cows_insemination has correct data types", {
  expect_s3_class(cows_insemination$Time, "factor")
  expect_equal(nlevels(cows_insemination$Time), 10)
  expect_type(cows_insemination$Sillod_Insemination_C1, "integer")
  expect_type(cows_insemination$Sillod_Conception_C1, "integer")
  expect_type(cows_insemination$Sillod_Insemination_C2, "integer")
  expect_type(cows_insemination$Sillod_Conception_C2, "integer")
  expect_type(cows_insemination$Sillod_Insemination_C3, "integer")
  expect_type(cows_insemination$Sillod_Conception_C3, "integer")
})
