MCPcopy Create free account
hub / github.com/cli/cli / TestDisplayName

Function TestDisplayName

api/queries_repo_test.go:801–824  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

799}
800
801func TestDisplayName(t *testing.T) {
802 tests := []struct {
803 name string
804 assignee AssignableUser
805 want string
806 }{
807 {
808 name: "assignee with name",
809 assignee: AssignableUser{"123", "octocat123", "Octavious Cath"},
810 want: "octocat123 (Octavious Cath)",
811 },
812 {
813 name: "assignee without name",
814 assignee: AssignableUser{"123", "octocat123", ""},
815 want: "octocat123",
816 },
817 }
818 for _, tt := range tests {
819 actual := tt.assignee.DisplayName()
820 if actual != tt.want {
821 t.Errorf("display name was %s wanted %s", actual, tt.want)
822 }
823 }
824}
825
826func TestActorDisplayName(t *testing.T) {
827 tests := []struct {

Callers

nothing calls this directly

Calls 2

DisplayNameMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected