32 lines
637 B
Go
32 lines
637 B
Go
package application
|
|
|
|
import "testing"
|
|
|
|
func TestEventTypeValid(t *testing.T) {
|
|
eventTypes := []EventType{
|
|
EventCatalogRefreshed,
|
|
EventCatalogRejected,
|
|
EventDownloadStarted,
|
|
EventDownloadProgress,
|
|
EventDownloadPaused,
|
|
EventDownloadCompleted,
|
|
EventDownloadFailed,
|
|
EventDownloadCanceled,
|
|
EventInstallCompleted,
|
|
EventInstallRolledBack,
|
|
EventAppStarted,
|
|
EventAppExited,
|
|
EventLicenseChanged,
|
|
}
|
|
|
|
for _, eventType := range eventTypes {
|
|
if !eventType.Valid() {
|
|
t.Errorf("event type %q should be valid", eventType)
|
|
}
|
|
}
|
|
|
|
if EventType("Unknown").Valid() {
|
|
t.Fatal("unknown event type should be invalid")
|
|
}
|
|
}
|