2015-02-04 08:37:26 -06:00
|
|
|
package events
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2015-02-04 09:57:20 -06:00
|
|
|
"time"
|
2015-02-04 08:37:26 -06:00
|
|
|
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
|
|
)
|
|
|
|
|
2015-02-04 09:57:20 -06:00
|
|
|
type TestEvent struct {
|
|
|
|
Timestamp time.Time
|
|
|
|
}
|
|
|
|
|
2015-02-04 08:37:26 -06:00
|
|
|
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),
|
|
|
|
}
|
|
|
|
|
2015-02-08 04:24:03 -06:00
|
|
|
wire, _ := ToOnWriteEvent(&e)
|
2015-02-04 09:57:20 -06:00
|
|
|
So(e.Timestamp.Unix(), ShouldEqual, wire.Timestamp.Unix())
|
|
|
|
So(wire.EventType, ShouldEqual, "TestEvent")
|
2015-02-04 08:37:26 -06:00
|
|
|
})
|
|
|
|
|
|
|
|
}
|