diff --git a/pkg/messages/msg_unparsed_message_test.go b/pkg/messages/msg_unparsed_message_test.go new file mode 100644 index 0000000..41d6192 --- /dev/null +++ b/pkg/messages/msg_unparsed_message_test.go @@ -0,0 +1,24 @@ +package messages + +import ( + "errors" + "github.com/stretchr/testify/require" + "main/pkg/types" + "testing" +) + +func TestMsgUnparsedMessageBase(t *testing.T) { + t.Parallel() + + msg := MsgUnparsedMessage{MsgType: "type", Error: errors.New("error")} + + require.Equal(t, "MsgUnparsedMessage", msg.Type()) + + msg.AddParsedMessage(nil) + msg.SetParsedMessages([]types.Message{}) + msg.GetAdditionalData(nil, "subscription") + + require.Empty(t, msg.GetValues()) + require.Empty(t, msg.GetParsedMessages()) + require.Empty(t, msg.GetRawMessages()) +} diff --git a/pkg/messages/msg_unsupported_message_test.go b/pkg/messages/msg_unsupported_message_test.go new file mode 100644 index 0000000..6bd9c5e --- /dev/null +++ b/pkg/messages/msg_unsupported_message_test.go @@ -0,0 +1,23 @@ +package messages + +import ( + "github.com/stretchr/testify/require" + "main/pkg/types" + "testing" +) + +func TestMsgUnsupportedMessageBase(t *testing.T) { + t.Parallel() + + msg := MsgUnsupportedMessage{MsgType: "type"} + + require.Equal(t, "MsgUnsupportedMessage", msg.Type()) + + msg.AddParsedMessage(nil) + msg.SetParsedMessages([]types.Message{}) + msg.GetAdditionalData(nil, "subscription") + + require.Empty(t, msg.GetValues()) + require.Empty(t, msg.GetParsedMessages()) + require.Empty(t, msg.GetRawMessages()) +}