-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmediatype_test.go
More file actions
44 lines (37 loc) · 880 Bytes
/
mediatype_test.go
File metadata and controls
44 lines (37 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// SPDX-FileCopyrightText: 2025 Comcast Cable Communications Management, LLC
// SPDX-License-Identifier: Apache-2.0
package wrphttp
import (
"sort"
"testing"
"github.com/stretchr/testify/assert"
)
func TestAllMediaTypes(t *testing.T) {
tests := []struct {
name string
expected []string
}{
{
name: "all media types",
expected: []string{
MEDIA_TYPE_JSON,
MEDIA_TYPE_MSGPACK,
MEDIA_TYPE_OCTET_STREAM,
MEDIA_TYPE_JSONL,
MEDIA_TYPE_MSGPACKL,
MEDIA_TYPE_OCTET_STREAM_X_XMIDT_STYLE,
MEDIA_TYPE_OCTET_STREAM_X_MIDT_STYLE,
MEDIA_TYPE_OCTET_STREAM_XMIDT_STYLE,
MEDIA_TYPE_OCTET_STREAM_WEBPA_STYLE,
},
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
actual := AllMediaTypes()
sort.Strings(actual)
sort.Strings(test.expected)
assert.ElementsMatch(t, test.expected, actual)
})
}
}