testing histogram series.
This commit is contained in:
parent
d088213b1e
commit
bff8e074fd
9 changed files with 203 additions and 18 deletions
31
continuous_series_test.go
Normal file
31
continuous_series_test.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package chart
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
assert "github.com/blendlabs/go-assert"
|
||||
)
|
||||
|
||||
func TestContinuousSeries(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
cs := ContinuousSeries{
|
||||
Name: "Test Series",
|
||||
XValues: Seq(1.0, 10.0),
|
||||
YValues: Seq(1.0, 10.0),
|
||||
}
|
||||
|
||||
assert.Equal("Test Series", cs.GetName())
|
||||
assert.Equal(10, cs.Len())
|
||||
x0, y0 := cs.GetValue(0)
|
||||
assert.Equal(1.0, x0)
|
||||
assert.Equal(1.0, y0)
|
||||
|
||||
xn, yn := cs.GetValue(9)
|
||||
assert.Equal(10.0, xn)
|
||||
assert.Equal(10.0, yn)
|
||||
|
||||
xn, yn = cs.GetLastValue()
|
||||
assert.Equal(10.0, xn)
|
||||
assert.Equal(10.0, yn)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue