MCPcopy Index your code
hub / github.com/cli/cli / TestDisplayName

Function TestDisplayName

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

Source from the content-addressed store, hash-verified

705}
706
707func TestDisplayName(t *testing.T) {
708 tests := []struct {
709 name string
710 assignee AssignableUser
711 want string
712 }{
713 {
714 name: "assignee with name",
715 assignee: AssignableUser{"123", "octocat123", "Octavious Cath"},
716 want: "octocat123 (Octavious Cath)",
717 },
718 {
719 name: "assignee without name",
720 assignee: AssignableUser{"123", "octocat123", ""},
721 want: "octocat123",
722 },
723 }
724 for _, tt := range tests {
725 actual := tt.assignee.DisplayName()
726 if actual != tt.want {
727 t.Errorf("display name was %s wanted %s", actual, tt.want)
728 }
729 }
730}
731
732func TestActorDisplayName(t *testing.T) {
733 tests := []struct {

Callers

nothing calls this directly

Calls 2

DisplayNameMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected