go-chart/sequence_test.go

27 lines
513 B
Go
Raw Normal View History

2016-07-30 03:24:25 +02:00
package chart
import (
"testing"
2016-08-01 01:54:09 +02:00
"time"
2016-07-30 03:24:25 +02:00
assert "github.com/blendlabs/go-assert"
)
func TestSequenceFloat64(t *testing.T) {
assert := assert.New(t)
asc := Sequence.Float64(1.0, 10.0)
assert.Len(asc, 10)
desc := Sequence.Float64(10.0, 1.0)
assert.Len(desc, 10)
}
2016-08-01 01:54:09 +02:00
func TestSequenceMarketHours(t *testing.T) {
assert := assert.New(t)
today := time.Date(2016, 07, 01, 12, 0, 0, 0, Date.Eastern())
mh := Sequence.MarketHours(today, today, NYSEOpen, NYSEClose, Date.IsNYSEHoliday)
assert.Len(mh, 7)
}