ac680bd82d
* Fixed order of arguments to assert.Len in test files. * Added BaseValue funtionality to bar chart
25 lines
420 B
Go
25 lines
420 B
Go
package chart
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/blend/go-sdk/assert"
|
|
)
|
|
|
|
func TestGenerateGridLines(t *testing.T) {
|
|
assert := assert.New(t)
|
|
|
|
ticks := []Tick{
|
|
{Value: 1.0, Label: "1.0"},
|
|
{Value: 2.0, Label: "2.0"},
|
|
{Value: 3.0, Label: "3.0"},
|
|
{Value: 4.0, Label: "4.0"},
|
|
}
|
|
|
|
gl := GenerateGridLines(ticks, Style{}, Style{})
|
|
assert.Len(gl, 2)
|
|
|
|
assert.Equal(2.0, gl[0].Value)
|
|
assert.Equal(3.0, gl[1].Value)
|
|
}
|