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,
|
2026-07-17 10:21:44 +08:00
|
|
|
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")
|
|
|
|
|
}
|
|
|
|
|
}
|