events_test.go 437 B

1234567891011121314151617181920212223242526
  1. package events
  2. import (
  3. "testing"
  4. "time"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. type TestEvent struct {
  8. Timestamp time.Time
  9. }
  10. func TestEventCreation(t *testing.T) {
  11. Convey("Event to wire event", t, func() {
  12. e := TestEvent{
  13. Timestamp: time.Unix(1231421123, 223),
  14. }
  15. wire, _ := ToOnWriteEvent(&e)
  16. So(e.Timestamp.Unix(), ShouldEqual, wire.Timestamp.Unix())
  17. So(wire.EventType, ShouldEqual, "TestEvent")
  18. })
  19. }