2016-07-06 21:54:00 -04:00
|
|
|
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}
|
2016-07-07 17:44:03 -04:00
|
|
|
r := Range{Domain: 1000}
|
|
|
|
r.Min, r.Max = MinAndMax(values...)
|
2016-07-06 21:54:00 -04:00
|
|
|
assert.Equal(428, r.Translate(5.0))
|
|
|
|
}
|