MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / TestSelectForSingleItem

Function TestSelectForSingleItem

pkg/question/selectors/selector_test.go:15–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13}
14
15func TestSelectForSingleItem(t *testing.T) {
16 itemsCallback := func() ([]*Item, error) {
17 return []*Item{
18 {
19 id: "1",
20 name: "name",
21 },
22 }, nil
23 }
24
25 selectedItem, err := Select(nil, "question", itemsCallback, func(item *Item) string { return item.name })
26 assert.Nil(t, err)
27 assert.Equal(t, selectedItem.id, "1")
28}
29
30func TestSelectForMultipleItem(t *testing.T) {
31 items := []*Item{

Callers

nothing calls this directly

Calls 1

SelectFunction · 0.70

Tested by

no test coverage detected