diff --git a/pkg/icingadb/types/notification_types_test.go b/pkg/icingadb/types/notification_types_test.go index 022568fe..b32f984c 100644 --- a/pkg/icingadb/types/notification_types_test.go +++ b/pkg/icingadb/types/notification_types_test.go @@ -32,3 +32,27 @@ func TestNotificationTypes_UnmarshalJSON(t *testing.T) { }) } } + +func TestNotificationTypes_Value(t *testing.T) { + subtests := []struct { + name string + io NotificationTypes + error bool + }{ + {name: "out-of-range", io: ^NotificationTypes(0), error: true}, + {name: "empty", io: 0}, + {name: "single", io: 32}, + {name: "multiple", io: 48}, + } + + for _, st := range subtests { + t.Run(st.name, func(t *testing.T) { + if v, err := st.io.Value(); st.error { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, int64(st.io), v) + } + }) + } +}