Skip to content

Commit ccd1805

Browse files
committed
Unify Inheritance to ROCrateObject
1 parent 2cea57c commit ccd1805

11 files changed

Lines changed: 262 additions & 0 deletions
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module Tests.Assay
2+
3+
open ARCtrl.ROCrate
4+
5+
open TestingUtils
6+
7+
let default_constructor = Assay("id")
8+
9+
let tests_profile_object_is_valid = testList "profile object is valid" [
10+
testCase "Id" <| fun _ -> Expect.equal default_constructor.Id "id" "mandatory field Id was not correct"
11+
testCase "SchemaType" <| fun _ -> Expect.equal default_constructor.SchemaType "schema.org/Dataset" "mandatory field SchemaType was not correct"
12+
testCase "AdditionalType" <| fun _ -> Expect.equal default_constructor.AdditionalType (Some "Assay") "optional field AdditionalType was not correct"
13+
testCase "Properties" <| fun _ -> Expect.isEmpty default_constructor.Properties "Dynamic properties were not empty"
14+
15+
// default constructors are missing mandatory fields from the profile. This is by design.
16+
testCase "missing identifier" <| fun _ -> Expect.throws (fun _ -> default_constructor.GetValue("identifier") |> ignore) "mandatory profile field identifier was present althoughit was expected to be missing"
17+
]
18+
19+
let tests_static_methods = testList "static methods" []
20+
21+
let tests_interface_members = testList "interface members" []
22+
23+
let tests_dynamic_members = testList "dynamic members" []
24+
25+
let main = testList "Assay" [
26+
tests_profile_object_is_valid
27+
tests_static_methods
28+
tests_interface_members
29+
tests_dynamic_members
30+
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module Tests.Data
2+
3+
open ARCtrl.ROCrate
4+
5+
open TestingUtils
6+
7+
let tests_profile_object_is_valid = testList "profile object is valid" []
8+
9+
let tests_static_methods = testList "static methods" []
10+
11+
let tests_interface_members = testList "interface members" []
12+
13+
let tests_dynamic_members = testList "dynamic members" []
14+
15+
let main = testList "Data" [
16+
tests_profile_object_is_valid
17+
tests_static_methods
18+
tests_interface_members
19+
tests_dynamic_members
20+
]
21+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module Tests.Dataset
2+
3+
open ARCtrl.ROCrate
4+
5+
open TestingUtils
6+
7+
let default_constructor = Dataset("id")
8+
9+
let tests_profile_object_is_valid = testList "profile object is valid" [
10+
testCase "Id" <| fun _ -> Expect.equal default_constructor.Id "id" "mandatory field Id was not correct"
11+
testCase "SchemaType" <| fun _ -> Expect.equal default_constructor.SchemaType "schema.org/Dataset" "mandatory field SchemaType was not correct"
12+
testCase "AdditionalType" <| fun _ -> Expect.isNone default_constructor.AdditionalType "optional field AdditionalType was not correct"
13+
testCase "Properties" <| fun _ -> Expect.isEmpty default_constructor.Properties "Dynamic properties were not empty"
14+
]
15+
16+
let tests_interface_members = testList "interface members" []
17+
18+
let tests_dynamic_members = testList "dynamic members" []
19+
20+
let main = testList "Dataset" [
21+
tests_profile_object_is_valid
22+
tests_interface_members
23+
tests_dynamic_members
24+
]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module Tests.Investigation
2+
3+
open ARCtrl.ROCrate
4+
5+
open TestingUtils
6+
7+
let default_constructor = Investigation("id")
8+
9+
let tests_profile_object_is_valid = testList "profile object is valid" [
10+
testCase "Id" <| fun _ -> Expect.equal default_constructor.Id "id" "mandatory field Id was not correct"
11+
testCase "SchemaType" <| fun _ -> Expect.equal default_constructor.SchemaType "schema.org/Dataset" "mandatory field SchemaType was not correct"
12+
testCase "AdditionalType" <| fun _ -> Expect.equal default_constructor.AdditionalType (Some "Investigation") "mandatory field AdditionalType was not correct"
13+
testCase "Properties" <| fun _ -> Expect.isEmpty default_constructor.Properties "Dynamic properties were not empty"
14+
15+
// default constructors are missing mandatory fields from the profile. This is by design.
16+
testCase "missing identifier" <| fun _ -> Expect.throws (fun _ -> default_constructor.GetValue("identifier") |> ignore) "mandatory profile field identifier was present althoughit was expected to be missing"
17+
]
18+
19+
let tests_static_methods = testList "static methods" []
20+
21+
let tests_interface_members = testList "interface members" []
22+
23+
let tests_dynamic_members = testList "dynamic members" []
24+
25+
let main = testList "Investigation" [
26+
tests_profile_object_is_valid
27+
tests_static_methods
28+
tests_interface_members
29+
tests_dynamic_members
30+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module Tests.LabProcess
2+
3+
open ARCtrl.ROCrate
4+
5+
open TestingUtils
6+
7+
let tests_profile_object_is_valid = testList "profile object is valid" []
8+
9+
let tests_static_methods = testList "static methods" []
10+
11+
let tests_interface_members = testList "interface members" []
12+
13+
let tests_dynamic_members = testList "dynamic members" []
14+
15+
let main = testList "LabProcess" [
16+
tests_profile_object_is_valid
17+
tests_static_methods
18+
tests_interface_members
19+
tests_dynamic_members
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module Tests.LabProtocol
2+
3+
open ARCtrl.ROCrate
4+
5+
open TestingUtils
6+
7+
let tests_profile_object_is_valid = testList "profile object is valid" []
8+
9+
let tests_static_methods = testList "static methods" []
10+
11+
let tests_interface_members = testList "interface members" []
12+
13+
let tests_dynamic_members = testList "dynamic members" []
14+
15+
let main = testList "LabProtocol" [
16+
tests_profile_object_is_valid
17+
tests_static_methods
18+
tests_interface_members
19+
tests_dynamic_members
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module Tests.Person
2+
3+
open ARCtrl.ROCrate
4+
5+
open TestingUtils
6+
7+
let tests_profile_object_is_valid = testList "profile object is valid" []
8+
9+
let tests_static_methods = testList "static methods" []
10+
11+
let tests_interface_members = testList "interface members" []
12+
13+
let tests_dynamic_members = testList "dynamic members" []
14+
15+
let main = testList "Person" [
16+
tests_profile_object_is_valid
17+
tests_static_methods
18+
tests_interface_members
19+
tests_dynamic_members
20+
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module Tests.PropertyValue
2+
3+
open ARCtrl.ROCrate
4+
5+
open TestingUtils
6+
7+
let tests_profile_object_is_valid = testList "profile object is valid" []
8+
9+
let tests_static_methods = testList "static methods" []
10+
11+
let tests_interface_members = testList "interface members" []
12+
13+
let tests_dynamic_members = testList "dynamic members" []
14+
15+
let main = testList "PropertyValue" [
16+
tests_profile_object_is_valid
17+
tests_static_methods
18+
tests_interface_members
19+
tests_dynamic_members
20+
]
21+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module Tests.Sample
2+
3+
open ARCtrl.ROCrate
4+
5+
open TestingUtils
6+
7+
let tests_profile_object_is_valid = testList "profile object is valid" []
8+
9+
let tests_static_methods = testList "static methods" []
10+
11+
let tests_interface_members = testList "interface members" []
12+
13+
let tests_dynamic_members = testList "dynamic members" []
14+
15+
let main = testList "Sample" [
16+
tests_profile_object_is_valid
17+
tests_static_methods
18+
tests_interface_members
19+
tests_dynamic_members
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module Tests.ScholarlyArticle
2+
3+
open ARCtrl.ROCrate
4+
5+
open TestingUtils
6+
7+
let tests_profile_object_is_valid = testList "profile object is valid" []
8+
9+
let tests_static_methods = testList "static methods" []
10+
11+
let tests_interface_members = testList "interface members" []
12+
13+
let tests_dynamic_members = testList "dynamic members" []
14+
15+
let main = testList "ScholarlyArticle" [
16+
tests_profile_object_is_valid
17+
tests_static_methods
18+
tests_interface_members
19+
tests_dynamic_members
20+
]

0 commit comments

Comments
 (0)