2016-07-13 04:38:24 +02:00
|
|
|
package chart
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2018-04-05 09:42:38 +02:00
|
|
|
"github.com/blend/go-sdk/assert"
|
2016-07-13 04:38:24 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestGenerateGridLines(t *testing.T) {
|
|
|
|
assert := assert.New(t)
|
|
|
|
|
|
|
|
ticks := []Tick{
|
2016-07-15 22:43:53 +02:00
|
|
|
{Value: 1.0, Label: "1.0"},
|
|
|
|
{Value: 2.0, Label: "2.0"},
|
|
|
|
{Value: 3.0, Label: "3.0"},
|
|
|
|
{Value: 4.0, Label: "4.0"},
|
2016-07-13 04:38:24 +02:00
|
|
|
}
|
|
|
|
|
2016-08-12 07:24:40 +02:00
|
|
|
gl := GenerateGridLines(ticks, Style{}, Style{})
|
2016-07-27 08:55:31 +02:00
|
|
|
assert.Len(gl, 2)
|
|
|
|
|
|
|
|
assert.Equal(2.0, gl[0].Value)
|
|
|
|
assert.Equal(3.0, gl[1].Value)
|
2016-07-13 04:38:24 +02:00
|
|
|
}
|