[MM-16751] golint model (#17896)
Этот коммит содержится в:
коммит произвёл
Claudio Costa
родитель
953eebdef4
Коммит
97ccf0bdf6
@@ -178,37 +178,37 @@ func TestUserGetFullName(t *testing.T) {
|
||||
func TestUserGetDisplayName(t *testing.T) {
|
||||
user := User{Username: "username"}
|
||||
|
||||
assert.Equal(t, user.GetDisplayName(SHOW_FULLNAME), "username", "Display name should be username")
|
||||
assert.Equal(t, user.GetDisplayName(SHOW_NICKNAME_FULLNAME), "username", "Display name should be username")
|
||||
assert.Equal(t, user.GetDisplayName(SHOW_USERNAME), "username", "Display name should be username")
|
||||
assert.Equal(t, user.GetDisplayName(ShowFullName), "username", "Display name should be username")
|
||||
assert.Equal(t, user.GetDisplayName(ShowNicknameFullName), "username", "Display name should be username")
|
||||
assert.Equal(t, user.GetDisplayName(ShowUsername), "username", "Display name should be username")
|
||||
|
||||
user.FirstName = "first"
|
||||
user.LastName = "last"
|
||||
|
||||
assert.Equal(t, user.GetDisplayName(SHOW_FULLNAME), "first last", "Display name should be full name")
|
||||
assert.Equal(t, user.GetDisplayName(SHOW_NICKNAME_FULLNAME), "first last", "Display name should be full name since there is no nickname")
|
||||
assert.Equal(t, user.GetDisplayName(SHOW_USERNAME), "username", "Display name should be username")
|
||||
assert.Equal(t, user.GetDisplayName(ShowFullName), "first last", "Display name should be full name")
|
||||
assert.Equal(t, user.GetDisplayName(ShowNicknameFullName), "first last", "Display name should be full name since there is no nickname")
|
||||
assert.Equal(t, user.GetDisplayName(ShowUsername), "username", "Display name should be username")
|
||||
|
||||
user.Nickname = "nickname"
|
||||
assert.Equal(t, user.GetDisplayName(SHOW_NICKNAME_FULLNAME), "nickname", "Display name should be nickname")
|
||||
assert.Equal(t, user.GetDisplayName(ShowNicknameFullName), "nickname", "Display name should be nickname")
|
||||
}
|
||||
|
||||
func TestUserGetDisplayNameWithPrefix(t *testing.T) {
|
||||
user := User{Username: "username"}
|
||||
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(SHOW_FULLNAME, "@"), "@username", "Display name should be username")
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(SHOW_NICKNAME_FULLNAME, "@"), "@username", "Display name should be username")
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(SHOW_USERNAME, "@"), "@username", "Display name should be username")
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(ShowFullName, "@"), "@username", "Display name should be username")
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(ShowNicknameFullName, "@"), "@username", "Display name should be username")
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(ShowUsername, "@"), "@username", "Display name should be username")
|
||||
|
||||
user.FirstName = "first"
|
||||
user.LastName = "last"
|
||||
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(SHOW_FULLNAME, "@"), "first last", "Display name should be full name")
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(SHOW_NICKNAME_FULLNAME, "@"), "first last", "Display name should be full name since there is no nickname")
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(SHOW_USERNAME, "@"), "@username", "Display name should be username")
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(ShowFullName, "@"), "first last", "Display name should be full name")
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(ShowNicknameFullName, "@"), "first last", "Display name should be full name since there is no nickname")
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(ShowUsername, "@"), "@username", "Display name should be username")
|
||||
|
||||
user.Nickname = "nickname"
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(SHOW_NICKNAME_FULLNAME, "@"), "nickname", "Display name should be nickname")
|
||||
assert.Equal(t, user.GetDisplayNameWithPrefix(ShowNicknameFullName, "@"), "nickname", "Display name should be nickname")
|
||||
}
|
||||
|
||||
type usernamesTest struct {
|
||||
|
||||
Ссылка в новой задаче
Block a user