This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
test-BioStratigraphy.r
138 lines (132 loc) · 3.54 KB
/
test-BioStratigraphy.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
library("nbaR")
library("testthat")
set.seed(111)
context("Testing class BioStratigraphy")
test_that("Constructor works", {
obj <- BioStratigraphy$new()
expect_is(obj, "BioStratigraphy")
# test constructor with random arguments
# test field youngBioDatingQualifier, type character
obj <- BioStratigraphy$new(
youngBioDatingQualifier = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field youngBioName, type character
obj <- BioStratigraphy$new(
youngBioName = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field youngFossilZone, type character
obj <- BioStratigraphy$new(
youngFossilZone = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field youngFossilSubZone, type character
obj <- BioStratigraphy$new(
youngFossilSubZone = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field youngBioCertainty, type character
obj <- BioStratigraphy$new(
youngBioCertainty = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field youngStratType, type character
obj <- BioStratigraphy$new(
youngStratType = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field bioDatingQualifier, type character
obj <- BioStratigraphy$new(
bioDatingQualifier = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field rangePosition, type character
obj <- BioStratigraphy$new(
rangePosition = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field oldBioName, type character
obj <- BioStratigraphy$new(
oldBioName = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field bioIdentifier, type character
obj <- BioStratigraphy$new(
bioIdentifier = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field oldFossilzone, type character
obj <- BioStratigraphy$new(
oldFossilzone = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field oldFossilSubzone, type character
obj <- BioStratigraphy$new(
oldFossilSubzone = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field oldBioCertainty, type character
obj <- BioStratigraphy$new(
oldBioCertainty = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
# test field oldBioStratType, type character
obj <- BioStratigraphy$new(
oldBioStratType = paste(sample(
c(LETTERS, letters),
sample(1:20, 1)
), collapse = "")
)
expect_is(obj, "BioStratigraphy")
})
test_that("toList works", {
obj <- BioStratigraphy$new()
l <- obj$toList()
expect_is(l, "list")
})
test_that("toJSONString works", {
obj <- BioStratigraphy$new()
s <- obj$toJSONString()
expect_is(s, "json")
expect_true(s != "")
})