Add domain states and event runtime (T-002)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package application
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestEventTypeValid(t *testing.T) {
|
||||
eventTypes := []EventType{
|
||||
EventCatalogRefreshed,
|
||||
EventCatalogRejected,
|
||||
EventDownloadStarted,
|
||||
EventDownloadProgress,
|
||||
EventDownloadPaused,
|
||||
EventDownloadCompleted,
|
||||
EventDownloadFailed,
|
||||
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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user