mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-19 04:50:02 +02:00
api/channel.go: Adding Channel.Type()
This commit is contained in:
parent
47dda7a3f4
commit
9e586d879d
2 changed files with 27 additions and 0 deletions
|
|
@ -90,6 +90,26 @@ func TestChannel_String(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestChannel_Type(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
c Channel
|
||||
want string
|
||||
}{
|
||||
{"Empty", Channel{}, "unknown"},
|
||||
{"Heartbeat", HeartbeatChannel, "heartbeat"},
|
||||
{"Transaction", TransactionChannel, "transactions"},
|
||||
{"Actions", ActionChannel{}.Channel(), "actions"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := tt.c.Type(); got != tt.want {
|
||||
t.Errorf("Channel.Type() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestAction_Channel(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue