go-chart/first_value_annotation_test.go

23 lines
433 B
Go
Raw Permalink Normal View History

2018-09-07 15:52:30 -04:00
package chart
import (
"testing"
"github.com/blend/go-sdk/assert"
)
func TestFirstValueAnnotation(t *testing.T) {
assert := assert.New(t)
series := ContinuousSeries{
XValues: []float64{1.0, 2.0, 3.0, 4.0, 5.0},
YValues: []float64{5.0, 3.0, 3.0, 2.0, 1.0},
}
fva := FirstValueAnnotation(series)
assert.NotEmpty(fva.Annotations)
fvaa := fva.Annotations[0]
assert.Equal(1, fvaa.XValue)
assert.Equal(5, fvaa.YValue)
}