Skip to content

Commit aec55f3

Browse files
committed
Initial arg tests for 'ds.kurtosis' and 'ds.skewness'
1 parent c60c31f commit aec55f3

2 files changed

Lines changed: 96 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#-------------------------------------------------------------------------------
2+
# Copyright (c) 2018-2020 University of Newcastle upon Tyne. All rights reserved.
3+
#
4+
# This program and the accompanying materials
5+
# are made available under the terms of the GNU Public License v3.0.
6+
#
7+
# You should have received a copy of the GNU General Public License
8+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
9+
#-------------------------------------------------------------------------------
10+
11+
#
12+
# Set up
13+
#
14+
15+
context("ds.kurtosis::arg::setup")
16+
17+
connect.studies.dataset.cnsim(list("LAB_TSC"))
18+
19+
test_that("setup", {
20+
ds_expect_variables(c("D"))
21+
})
22+
23+
#
24+
# Tests
25+
#
26+
27+
context("ds.kurtosis::arg::test errors")
28+
test_that("kurtosis_erros", {
29+
expect_error(ds.kurtosis(), "Please provide the name of the input vector!", fixed=TRUE)
30+
res <- ds.kurtosis(x='D$LAB_TSC', type='datashield')
31+
expect_true(is.null(res))
32+
expect_error(ds.kurtosis(x='D$LAB_TSC', method="0"), "method must be an integer between 1 and 3", fixed=TRUE)
33+
expect_error(ds.kurtosis(x='D$LAB_TSC', method="4"), "method must be an integer between 1 and 3", fixed=TRUE)
34+
})
35+
36+
#
37+
# Done
38+
#
39+
40+
context("ds.kurtosis::arg::shutdown")
41+
42+
test_that("shutdown", {
43+
ds_expect_variables(c("D"))
44+
})
45+
46+
disconnect.studies.dataset.cnsim()
47+
48+
context("ds.kurtosis::arg::done")
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#-------------------------------------------------------------------------------
2+
# Copyright (c) 2018-2020 University of Newcastle upon Tyne. All rights reserved.
3+
#
4+
# This program and the accompanying materials
5+
# are made available under the terms of the GNU Public License v3.0.
6+
#
7+
# You should have received a copy of the GNU General Public License
8+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
9+
#-------------------------------------------------------------------------------
10+
11+
#
12+
# Set up
13+
#
14+
15+
context("ds.skewness::arg::setup")
16+
17+
connect.studies.dataset.cnsim(list("LAB_TSC"))
18+
19+
test_that("setup", {
20+
ds_expect_variables(c("D"))
21+
})
22+
23+
#
24+
# Tests
25+
#
26+
27+
context("ds.skewness::arg::test errors")
28+
test_that("skewness_erros", {
29+
expect_error(ds.skewness(), "Please provide the name of the input vector!", fixed=TRUE)
30+
res <- ds.skewness(x='D$LAB_TSC', type='datashield')
31+
expect_true(is.null(res))
32+
expect_error(ds.skewness(x='D$LAB_TSC', method="0"), "method must be an integer between 1 and 3", fixed=TRUE)
33+
expect_error(ds.skewness(x='D$LAB_TSC', method="4"), "method must be an integer between 1 and 3", fixed=TRUE)
34+
})
35+
36+
#
37+
# Done
38+
#
39+
40+
context("ds.skewness::arg::shutdown")
41+
42+
test_that("shutdown", {
43+
ds_expect_variables(c("D"))
44+
})
45+
46+
disconnect.studies.dataset.cnsim()
47+
48+
context("ds.skewness::arg::done")

0 commit comments

Comments
 (0)