File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 <Compile Include =" JsonIO\OntologySourceReference.fs" />
1919 <Compile Include =" JsonIO\DataFile.fs" />
2020 <Compile Include =" JsonIO\Data.fs" />
21+ <Compile Include =" JsonIO\Datamap.fs" />
2122 <Compile Include =" JsonIO\Person.fs" />
2223 <Compile Include =" JsonIO\Publication.fs" />
2324 <Compile Include =" JsonIO\Process\Value.fs" />
Original file line number Diff line number Diff line change 2020 <Compile Include =" JsonIO\OntologySourceReference.fs" />
2121 <Compile Include =" JsonIO\DataFile.fs" />
2222 <Compile Include =" JsonIO\Data.fs" />
23+ <Compile Include =" JsonIO\Datamap.fs" />
2324 <Compile Include =" JsonIO\Person.fs" />
2425 <Compile Include =" JsonIO\Publication.fs" />
2526 <Compile Include =" JsonIO\Process\Value.fs" />
Original file line number Diff line number Diff line change 4444 <Compile Include =" JsonIO\Table\CompositeHeader.fs" />
4545 <Compile Include =" JsonIO\Table\ArcTable.fs" />
4646 <Compile Include =" JsonIO\Table\Templates.fs" />
47- <Compile Include =" JsonIO\DataMap\DataMap.fs" />
4847 <Compile Include =" JsonIO\Assay.fs" />
4948 <Compile Include =" JsonIO\Study.fs" />
5049 <Compile Include =" JsonIO\Investigation.fs" />
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -19,14 +19,14 @@ module DatamapExtensions =
1919 member this.ToJsonString (? spaces ) =
2020 DataMap.toJsonString( ?spaces= spaces) this
2121
22- static member fromCompressedJsonString ( s : string ) =
23- try Decode.fromJsonString ( Compression.decode DataMap.decoderCompressed) s with
24- | e -> failwithf " Error. Unable to parse json string to Datamap: %s " e.Message
22+ // static member fromCompressedJsonString (s: string) =
23+ // try Decode.fromJsonString (Compression.decode DataMap.decoderCompressed) s with
24+ // | e -> failwithf "Error. Unable to parse json string to Datamap: %s" e.Message
2525
26- static member toCompressedJsonString (? spaces ) =
27- fun ( obj : DataMap ) ->
28- let spaces = defaultArg spaces 0
29- Encode.toJsonString spaces ( Compression.encode DataMap.encoderCompressed obj)
26+ // static member toCompressedJsonString(?spaces) =
27+ // fun (obj:DataMap) ->
28+ // let spaces = defaultArg spaces 0
29+ // Encode.toJsonString spaces (Compression.encode DataMap.encoderCompressed obj)
3030
31- member this.ToCompressedJsonString (? spaces ) =
32- DataMap.toCompressedJsonString( ?spaces= spaces) this
31+ // member this.ToCompressedJsonString(?spaces) =
32+ // DataMap.toCompressedJsonString(?spaces=spaces) this
Original file line number Diff line number Diff line change @@ -21,8 +21,42 @@ module Helper =
2121 " Kevin F" ,
2222 ( ResizeArray [ Comment.create( " Hello" , " World" )])
2323 )
24+
2425 let create_filled () =
2526 DataMap( ResizeArray [
2627 for i in 1 .. 3 do
2728 create_ Datacontext i
2829 ])
30+
31+ let compare =
32+ fun ( d1 : DataMap ) ( d2 : DataMap ) ->
33+ let d1DataContexts =
34+ d1.DataContexts
35+ |> Array.ofSeq
36+ let d2DataContexts =
37+ d2.DataContexts
38+ |> Array.ofSeq
39+
40+ Expect.equal d1DataContexts.Length d2DataContexts.Length " Datamap Länge"
41+
42+ for i in 0 .. d1DataContexts.Length - 1 do
43+
44+ Expect.equal d1DataContexts.[ i] d2DataContexts.[ i] $" Datamap is not equal on {i}"
45+
46+ Expect.sequenceEqual d1.DataContexts d2.DataContexts " DataContexts"
47+ |> Some
48+
49+ open Helper
50+
51+ let private test_datamapJsonTesting =
52+ createBaseJsonTests
53+ " datamap-json"
54+ create_ filled
55+ DataMap.toJsonString
56+ DataMap.fromJsonString
57+ None
58+ compare
59+
60+ let main = testList " Datamap" [
61+ test_ datamapJsonTesting
62+ ]
You can’t perform that action at this time.
0 commit comments