Codebase list golang-github-nlopes-slack / upstream/0.6.0+dfsg slackutilsx / slackutilsx_test.go
upstream/0.6.0+dfsg

Tree @upstream/0.6.0+dfsg (Download .tar.gz)

slackutilsx_test.go @upstream/0.6.0+dfsgraw · history · blame

package slackutilsx

import (
	"testing"
)

func TestDetectChannelType(t *testing.T) {
	test := func(channelID string, expected ChannelType) {
		if computed := DetectChannelType(channelID); computed != expected {
			t.Errorf("expected channelID %s to have type %s, got: %s", channelID, expected, computed)
		}
	}

	test("G11111111", CTypeGroup)
	test("D11111111", CTypeDM)
	test("C11111111", CTypeChannel)
	test("", CTypeUnknown)
	test("X11111111", CTypeUnknown)
}