package application import "testing" func TestEventTypeValid(t *testing.T) { eventTypes := []EventType{ EventCatalogRefreshed, EventCatalogRejected, EventDownloadStarted, EventDownloadProgress, EventDownloadPaused, EventDownloadCompleted, EventDownloadFailed, EventDownloadCanceled, EventInstallCompleted, EventInstallRolledBack, EventAppStarted, EventAppExited, EventLicenseChanged, EventIconReady, EventIconFailed, } 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") } }