grafana/pkg/events/events_test.go

27 lines
437 B
Go
Raw Normal View History

package events
import (
"testing"
2015-02-04 09:57:20 -06:00
"time"
. "github.com/smartystreets/goconvey/convey"
)
2015-02-04 09:57:20 -06:00
type TestEvent struct {
Timestamp time.Time
}
func TestEventCreation(t *testing.T) {
2015-02-04 09:57:20 -06:00
Convey("Event to wire event", t, func() {
e := TestEvent{
Timestamp: time.Unix(1231421123, 223),
}
wire, _ := ToOnWriteEvent(&e)
2015-02-04 09:57:20 -06:00
So(e.Timestamp.Unix(), ShouldEqual, wire.Timestamp.Unix())
So(wire.EventType, ShouldEqual, "TestEvent")
})
}