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

Function TestDisplayName

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

Source from the content-addressed store, hash-verified

788}
789
790func TestDisplayName(t *testing.T) {
791 tests := []struct {
792 name string
793 assignee AssignableUser
794 want string
795 }{
796 {
797 name: "assignee with name",
798 assignee: AssignableUser{"123", "octocat123", "Octavious Cath"},
799 want: "octocat123 (Octavious Cath)",
800 },
801 {
802 name: "assignee without name",
803 assignee: AssignableUser{"123", "octocat123", ""},
804 want: "octocat123",
805 },
806 }
807 for _, tt := range tests {
808 actual := tt.assignee.DisplayName()
809 if actual != tt.want {
810 t.Errorf("display name was %s wanted %s", actual, tt.want)
811 }
812 }
813}
814
815func TestActorDisplayName(t *testing.T) {
816 tests := []struct {

Callers

nothing calls this directly

Calls 2

DisplayNameMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected