go-chart/range_test.go
Will Charczuk cbc4672f1e updates.
2016-07-07 14:44:03 -07:00

15 lines
301 B
Go

package chart
import (
"testing"
"github.com/blendlabs/go-assert"
)
func TestRangeTranslate(t *testing.T) {
assert := assert.New(t)
values := []float64{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0}
r := Range{Domain: 1000}
r.Min, r.Max = MinAndMax(values...)
assert.Equal(428, r.Translate(5.0))
}