grafana/pkg/events/events_test.go
Arve Knudsen 41d432b5ae
Chore: Enable whitespace linter (#25903)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-06 20:17:28 +02:00

25 lines
435 B
Go

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