package xerr

import "testing"

func TestDeviceAlreadyRegisteredMessageIncludesCountAndDisplayIDs(t *testing.T) {
	got := DeviceAlreadyRegisteredMessage(2, []string{"6400", "168430"})
	want := "you device already register 2 account 6400,168430, login failed"
	if got != want {
		t.Fatalf("DeviceAlreadyRegisteredMessage() = %q, want %q", got, want)
	}
}

func TestDeviceAlreadyRegisteredMessageCleansDisplayIDs(t *testing.T) {
	got := DeviceAlreadyRegisteredMessage(1, []string{" 6400 ", "", "6400"})
	want := "you device already register 1 account 6400, login failed"
	if got != want {
		t.Fatalf("DeviceAlreadyRegisteredMessage() = %q, want %q", got, want)
	}
}
