Files
soft_quay/core/application/event_test.go
T

34 lines
674 B
Go
Raw Normal View History

2026-07-16 15:31:41 +08:00
package application
import "testing"
func TestEventTypeValid(t *testing.T) {
eventTypes := []EventType{
EventCatalogRefreshed,
EventCatalogRejected,
EventDownloadStarted,
EventDownloadProgress,
EventDownloadPaused,
EventDownloadCompleted,
EventDownloadFailed,
2026-07-16 19:49:06 +08:00
EventDownloadCanceled,
2026-07-16 15:31:41 +08:00
EventInstallCompleted,
EventInstallRolledBack,
EventAppStarted,
EventAppExited,
EventLicenseChanged,
EventIconReady,
EventIconFailed,
2026-07-16 15:31:41 +08:00
}
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")
}
}