diff --git a/message/set.go b/message/set.go deleted file mode 100644 index 3c2326e..0000000 --- a/message/set.go +++ /dev/null @@ -1,28 +0,0 @@ -package message - -import ( - "github.com/dogmatiq/dogma" - "github.com/dogmatiq/enginekit/collections/sets" -) - -// NamesOf returns a name set containing the names of the given messages. -func NamesOf(messages ...dogma.Message) *sets.Set[Name] { - names := &sets.Set[Name]{} - - for _, m := range messages { - names.Add(NameOf(m)) - } - - return names -} - -// TypesOf returns a type set containing the types of the given messages. -func TypesOf(messages ...dogma.Message) *sets.Set[Type] { - types := &sets.Set[Type]{} - - for _, m := range messages { - types.Add(TypeOf(m)) - } - - return types -} diff --git a/message/set_test.go b/message/set_test.go deleted file mode 100644 index 76967be..0000000 --- a/message/set_test.go +++ /dev/null @@ -1,27 +0,0 @@ -package message_test - -import ( - "testing" - - . "github.com/dogmatiq/configkit/message" - "github.com/dogmatiq/enginekit/collections/sets" - . "github.com/dogmatiq/enginekit/enginetest/stubs" -) - -func TestNamesOf(t *testing.T) { - got := NamesOf(CommandA1, EventA1) - want := sets.New(NameOf(CommandA1), NameOf(EventA1)) - - if !got.IsEqual(want) { - t.Fatalf("unexpected result: got %v, want %v", got, want) - } -} - -func TestTypesOf(t *testing.T) { - got := TypesOf(CommandA1, EventA1) - want := sets.New(TypeOf(CommandA1), TypeOf(EventA1)) - - if !got.IsEqual(want) { - t.Fatalf("unexpected result: got %v, want %v", got, want) - } -}