Debian Codegraph @

first_value_annotation_test.go

raw symbols SCIP
1 package chart
2
3 import (
4 "testing"
5
6 "github.com/wcharczuk/go-chart/v2/testutil"
7 )
8
9 func TestFirstValueAnnotation(t *testing.T) {
10 // replaced new assertions helper
11
12 series := ContinuousSeries{
13 XValues: []float64{1.0, 2.0, 3.0, 4.0, 5.0},
14 YValues: []float64{5.0, 3.0, 3.0, 2.0, 1.0},
15 }
16
17 fva := FirstValueAnnotation(series)
18 testutil.AssertNotEmpty(t, fva.Annotations)
19 fvaa := fva.Annotations[0]
20 testutil.AssertEqual(t, 1, fvaa.XValue)
21 testutil.AssertEqual(t, 5, fvaa.YValue)
22 }