@@ -5,7 +5,7 @@ open ARCtrl
5
5
open TestingUtils
6
6
7
7
let private assay_Identifier = " MyAssay"
8
- let private assay_MeasurementType = OntologyAnnotation.fromString ( " My Measurement Type" , " MST" , " MST:42424242" )
8
+ let private assay_MeasurementType = OntologyAnnotation( " My Measurement Type" , " MST" , " MST:42424242" )
9
9
let private create_ExampleAssay () = ArcAssay.create( assay_ Identifier, assay_ MeasurementType)
10
10
let private create_ExampleAssays () = ResizeArray([ create_ ExampleAssay()])
11
11
@@ -17,13 +17,13 @@ let private tests_create =
17
17
let description = " Investigation Description"
18
18
let submissionDate = " 2023-07-19"
19
19
let publicReleaseDate = " 2023-12-31"
20
- let ontologySourceReferences = [| OntologySourceReference.create( " Reference 1" )|]
21
- let publications = [| Publication.create( " Publication 1" )|]
22
- let contacts = [| Person.create( FirstName = " John" , LastName = " Doe" )|]
20
+ let ontologySourceReferences = ResizeArray [| OntologySourceReference.create( " Reference 1" )|]
21
+ let publications = ResizeArray [| Publication.create( " Publication 1" )|]
22
+ let contacts = ResizeArray [| Person.create( firstName = " John" , lastName = " Doe" )|]
23
23
let assays = create_ ExampleAssays()
24
24
let studies = ResizeArray([| ArcStudy.init( " Study 1" )|])
25
- let comments = [| Comment.create( " Comment 1" )|]
26
- let remarks = [| Remark.create( 1 , " Remark 1" )|]
25
+ let comments = ResizeArray [| Comment.create( " Comment 1" )|]
26
+ let remarks = ResizeArray [| Remark.create( 1 , " Remark 1" )|]
27
27
28
28
let actual =
29
29
ArcInvestigation(
@@ -60,13 +60,13 @@ let private tests_create =
60
60
let description = " Investigation Description"
61
61
let submissionDate = " 2023-07-19"
62
62
let publicReleaseDate = " 2023-12-31"
63
- let ontologySourceReferences = [| OntologySourceReference.create( " Reference 1" )|]
64
- let publications = [| Publication.create( " Publication 1" )|]
65
- let contacts = [| Person.create( FirstName = " John" , LastName = " Doe" )|]
63
+ let ontologySourceReferences = ResizeArray [| OntologySourceReference.create( " Reference 1" )|]
64
+ let publications = ResizeArray [| Publication.create( " Publication 1" )|]
65
+ let contacts = ResizeArray [| Person.create( firstName = " John" , lastName = " Doe" )|]
66
66
let assays = create_ ExampleAssays()
67
- let studies = ResizeArray( [| ArcStudy.init( " Study 1" )|])
68
- let comments = [| Comment.create( " Comment 1" )|]
69
- let remarks = [| Remark.create( 1 , " Remark 1" )|]
67
+ let studies = ResizeArray [| ArcStudy.init( " Study 1" )|]
68
+ let comments = ResizeArray [| Comment.create( " Comment 1" )|]
69
+ let remarks = ResizeArray [| Remark.create( 1 , " Remark 1" )|]
70
70
71
71
let actual = ArcInvestigation.create(
72
72
identifier = identifier,
@@ -120,14 +120,14 @@ let private tests_create =
120
120
let description = Some " Investigation Description"
121
121
let submissionDate = Some " 2023-07-19"
122
122
let publicReleaseDate = Some " 2023-12-31"
123
- let ontologySourceReferences = [| OntologySourceReference.create( " Reference 1" )|]
124
- let publications = [| Publication.create( " Publication 1" )|]
125
- let contacts = [| Person.create( FirstName = " John" , LastName = " Doe" )|]
123
+ let ontologySourceReferences = ResizeArray [| OntologySourceReference.create( " Reference 1" )|]
124
+ let publications = ResizeArray [| Publication.create( " Publication 1" )|]
125
+ let contacts = ResizeArray [| Person.create( firstName = " John" , lastName = " Doe" )|]
126
126
let assays = create_ ExampleAssays()
127
127
let studies = ResizeArray([| ArcStudy.init( " Study 1" )|])
128
128
let registeredStudyIdentifiers = ResizeArray([ " Study 1" ])
129
- let comments = [| Comment.create( " Comment 1" )|]
130
- let remarks = [| Remark.create( 1 , " Remark 1" )|]
129
+ let comments = ResizeArray [| Comment.create( " Comment 1" )|]
130
+ let remarks = ResizeArray [| Remark.create( 1 , " Remark 1" )|]
131
131
132
132
let actual =
133
133
ArcInvestigation.make
@@ -299,7 +299,7 @@ let tests_MutableFields = testList "MutableFields" [
299
299
Expect.equal i.Description None " "
300
300
testCase " test mutable fields" <| fun _ ->
301
301
let i = ArcInvestigation.init( " MyInvestigation" )
302
- let persons = [| Person.create( FirstName = " Kevin" , LastName = " Frey" )|]
302
+ let persons = ResizeArray [| Person.create( firstName = " Kevin" , lastName = " Frey" )|]
303
303
i.Description <- Some " MyName"
304
304
i.Contacts <- persons
305
305
i.Title <- Some " Awesome Title"
@@ -328,15 +328,15 @@ let tests_MutableFields = testList "MutableFields" [
328
328
let tests_Copy = testList " Copy" [
329
329
testCase " test mutable fields" <| fun _ ->
330
330
let i = ArcInvestigation.init( " MyInvestigation" )
331
- let persons = [| Person.create( FirstName = " Kevin" , LastName = " Frey" )|]
331
+ let persons = ResizeArray [| Person.create( firstName = " Kevin" , lastName = " Frey" )|]
332
332
i.Description <- Some " MyName"
333
333
i.Contacts <- persons
334
334
i.Title <- Some " Awesome Title"
335
335
Expect.equal i.Description ( Some " MyName" ) " FileName"
336
336
Expect.equal i.Contacts persons " Contacts"
337
337
Expect.equal i.Title ( Some " Awesome Title" ) " Title"
338
338
let copy = i.Copy()
339
- let nextPersons = [| Person.create( FirstName = " Pascal" , LastName = " Gevangen" )|]
339
+ let nextPersons = ResizeArray [| Person.create( firstName = " Pascal" , lastName = " Gevangen" )|]
340
340
copy.Description <- Some " Next FileName"
341
341
copy.Contacts <- nextPersons
342
342
copy.Title <- Some " Next Title"
@@ -348,7 +348,7 @@ let tests_Copy = testList "Copy" [
348
348
Expect.equal copy.Title ( Some " Next Title" ) " copy Title"
349
349
testCase " test mutable fields on study" <| fun _ ->
350
350
let i = ArcInvestigation.init( " MyInvestigation" )
351
- let persons = [| Person.create( FirstName = " Kevin" , LastName = " Frey" )|]
351
+ let persons = ResizeArray [| Person.create( firstName = " Kevin" , lastName = " Frey" )|]
352
352
i.Description <- Some " MyName"
353
353
i.Contacts <- persons
354
354
i.Title <- Some " Awesome Title"
@@ -363,7 +363,7 @@ let tests_Copy = testList "Copy" [
363
363
Expect.equal sNext.Description ( Some " My Test Desciption" ) " study description"
364
364
// Create `copy` and change params. Then `i` should still be the same while `copy` must be changed
365
365
let copy = i.Copy()
366
- let nextPersons = [| Person.create( FirstName = " Pascal" , LastName = " Gevangen" )|]
366
+ let nextPersons = ResizeArray [| Person.create( firstName = " Pascal" , lastName = " Gevangen" )|]
367
367
copy.Description <- Some " Next FileName"
368
368
copy.Contacts <- nextPersons
369
369
copy.Title <- Some " Next Title"
@@ -489,7 +489,7 @@ let tests_Assay = testList "CRUD Assay" [
489
489
testCase " by index" <| fun _ ->
490
490
let i = createExampleInvestigation()
491
491
let assay_ident = " New Assay"
492
- let assay_techPlatform = OntologyAnnotation.fromString ( " Assay Tech" )
492
+ let assay_techPlatform = OntologyAnnotation( " Assay Tech" )
493
493
let expected = ArcAssay( assay_ ident, technologyPlatform = assay_ techPlatform)
494
494
i.AddAssay( expected)
495
495
i.RegisterAssayAt( 0 , expected.Identifier)
@@ -501,7 +501,7 @@ let tests_Assay = testList "CRUD Assay" [
501
501
testCase " by identifier" <| fun _ ->
502
502
let i = createExampleInvestigation()
503
503
let assay_ident = " New Assay"
504
- let assay_techPlatform = OntologyAnnotation.fromString ( " Assay Tech" )
504
+ let assay_techPlatform = OntologyAnnotation( " Assay Tech" )
505
505
let expected = ArcAssay( assay_ ident, technologyPlatform = assay_ techPlatform)
506
506
i.AddAssay( expected)
507
507
i.RegisterAssay( " Study 1" , expected.Identifier)
@@ -515,7 +515,7 @@ let tests_Assay = testList "CRUD Assay" [
515
515
testCase " by index" <| fun _ ->
516
516
let i = createExampleInvestigation()
517
517
let assay_ident = " New Assay"
518
- let assay_techPlatform = OntologyAnnotation.fromString ( " Assay Tech" )
518
+ let assay_techPlatform = OntologyAnnotation( " Assay Tech" )
519
519
let expected = ArcAssay( assay_ ident, technologyPlatform = assay_ techPlatform)
520
520
i.SetAssayAt( 0 , expected)
521
521
Expect.equal i.StudyCount 2 " StudyCount"
@@ -526,7 +526,7 @@ let tests_Assay = testList "CRUD Assay" [
526
526
testCase " by index tpOntology" <| fun _ ->
527
527
let i = createExampleInvestigation()
528
528
let assay_ident = " New Assay"
529
- let assay_techPlatform = OntologyAnnotation.fromString ( " Assay Tech" , " ABC" , " ABC:123" )
529
+ let assay_techPlatform = OntologyAnnotation( " Assay Tech" , " ABC" , " ABC:123" )
530
530
let expected = ArcAssay( assay_ ident, technologyPlatform = assay_ techPlatform)
531
531
i.SetAssayAt( 0 , expected)
532
532
Expect.equal i.StudyCount 2 " StudyCount"
@@ -537,7 +537,7 @@ let tests_Assay = testList "CRUD Assay" [
537
537
testCase " by identifier" <| fun _ ->
538
538
let i = createExampleInvestigation()
539
539
let assay_ident = " New Assay"
540
- let assay_techPlatform = OntologyAnnotation.fromString ( " Assay Tech" )
540
+ let assay_techPlatform = OntologyAnnotation( " Assay Tech" )
541
541
let expected = ArcAssay( assay_ ident, technologyPlatform = assay_ techPlatform)
542
542
i.SetAssay( " Assay 2" , expected)
543
543
Expect.equal i.StudyCount 2 " StudyCount"
@@ -562,7 +562,7 @@ let tests_Assay = testList "CRUD Assay" [
562
562
Expect.equal a.Identifier " Assay 2" " FileName"
563
563
testCase " mutable propagation" <| fun _ ->
564
564
let i = createExampleInvestigation()
565
- let tech = Some ( OntologyAnnotation.fromString ( " New Tech Stuff" ))
565
+ let tech = Some ( OntologyAnnotation( " New Tech Stuff" ))
566
566
let a = i.GetAssayAt( 0 )
567
567
Expect.equal a.Identifier " Assay 1" " FileName"
568
568
Expect.equal a.TechnologyPlatform None " TechnologyPlatform"
@@ -572,7 +572,7 @@ let tests_Assay = testList "CRUD Assay" [
572
572
testCase " mutable propagation, copy" <| fun _ ->
573
573
let i = createExampleInvestigation()
574
574
let copy = createExampleInvestigation()
575
- let tech = Some ( OntologyAnnotation.fromString ( " New Tech Stuff" ))
575
+ let tech = Some ( OntologyAnnotation( " New Tech Stuff" ))
576
576
let a = i.GetAssayAt( 0 )
577
577
Expect.equal a.Identifier " Assay 1" " FileName"
578
578
Expect.equal a.TechnologyPlatform None " TechnologyPlatform"
@@ -706,14 +706,14 @@ let private tests_GetHashCode = testList "GetHashCode" [
706
706
( Some " My Inv Description" )
707
707
( Some " My Inv SubmissionDate" )
708
708
( Some " My Inv PRD" )
709
- [| OntologySourceReference.create ( " Some Lorem ipsum description" , Name = " Descriptore" ); OntologySourceReference.empty|]
710
- [| Publication.empty ; Publication.create ( Title = " Some nice title" )|]
711
- ([| Person.create ( FirstName = " John" , LastName = " Doe" ); Person.create ( FirstName = " Jane" , LastName = " Doe" )|])
712
- ( ResizeArray([ ArcAssay.init( " Registered Assay1" ); ArcAssay.init( " Registered Assay2" )]))
713
- ( ResizeArray([ ArcStudy.init( " Registered Study1" ); ArcStudy.init( " Registered Study2" )]))
714
- ( ResizeArray([ " Registered Study1" ; " Registered Study2" ]))
715
- ([| Comment.create ( " Hello" , " World" ); Comment.create ( " ByeBye" , " World" ) |])
716
- [| Remark.create( 12 , " Test" ); Remark.create( 42 , " The answer" )|]
709
+ ( ResizeArray [| OntologySourceReference( " Some Lorem ipsum description" , name = " Descriptore" ); OntologySourceReference.empty|])
710
+ ( ResizeArray [| Publication() ; Publication( title = " Some nice title" )|])
711
+ ( ResizeArray [| Person( firstName = " John" , lastName = " Doe" ); Person( firstName = " Jane" , lastName = " Doe" )|])
712
+ ( ResizeArray ([ ArcAssay.init( " Registered Assay1" ); ArcAssay.init( " Registered Assay2" )]))
713
+ ( ResizeArray ([ ArcStudy.init( " Registered Study1" ); ArcStudy.init( " Registered Study2" )]))
714
+ ( ResizeArray ([ " Registered Study1" ; " Registered Study2" ]))
715
+ ( ResizeArray [| Comment( " Hello" , " World" ); Comment( " ByeBye" , " World" ) |])
716
+ ( ResizeArray [| Remark.create( 12 , " Test" ); Remark.create( 42 , " The answer" )|])
717
717
let copy = actual.Copy()
718
718
Expect.equal ( actual.GetHashCode()) ( copy.GetHashCode()) " "
719
719
testCase " not equal" <| fun _ ->
0 commit comments