1+ module Tests.LayoutObjects.TraceStyle
2+
3+ open Expecto
4+ open Plotly.NET
5+ open Plotly.NET .LayoutObjects
6+ open Plotly.NET .TraceObjects
7+ open Plotly.NET .GenericChart
8+
9+ let createEmptyTrace () = Trace2D.initScatter( id)
10+
11+ [<Tests>]
12+ let ``TraceStyle tests`` =
13+ testList " Traces.TraceStyle" [
14+ testCase " SetMarker" ( fun _ ->
15+ Expect.equal
16+ ( createEmptyTrace() |> TraceStyle.SetMarker( Marker.init( Color= Color.fromKeyword Red, Opacity = 0. )))
17+ ( Trace2D.initScatter( Trace2DStyle.Scatter( Marker = Marker.init( Color= Color.fromKeyword Red, Opacity = 0. ))))
18+ " TraceStyle.SetMarker did not produce the correct trace object"
19+ )
20+ testCase " Marker" ( fun _ ->
21+ Expect.equal
22+ ( createEmptyTrace() |> TraceStyle.Marker( Color= Color.fromKeyword Red, Opacity = 0. ))
23+ ( Trace2D.initScatter( Trace2DStyle.Scatter( Marker = Marker.init( Color= Color.fromKeyword Red, Opacity = 0. ))))
24+ " TraceStyle.Marker did not produce the correct trace object"
25+ )
26+ testCase " SetLine" ( fun _ ->
27+ Expect.equal
28+ ( createEmptyTrace() |> TraceStyle.SetLine( Line.init( Color= Color.fromKeyword Red, Width = 0. )))
29+ ( Trace2D.initScatter( Trace2DStyle.Scatter( Line = Line.init( Color= Color.fromKeyword Red, Width = 0. ))))
30+ " TraceStyle.SetLine did not produce the correct trace object"
31+ )
32+ testCase " Line" ( fun _ ->
33+ Expect.equal
34+ ( createEmptyTrace() |> TraceStyle.Line( Color= Color.fromKeyword Red, Width = 0. ))
35+ ( Trace2D.initScatter( Trace2DStyle.Scatter( Line = Line.init( Color= Color.fromKeyword Red, Width = 0. ))))
36+ " TraceStyle.Line did not produce the correct trace object"
37+ )
38+ ]
0 commit comments