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

Function TestQuestion_DeleteWithConfirmation_Success

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

Source from the content-addressed store, hash-verified

13)
14
15func TestQuestion_DeleteWithConfirmation_Success(t *testing.T) {
16 qa := testutil.NewAskMocker()
17 errReceiver := testutil.GoBegin(func() error {
18 return question.DeleteWithConfirmation(qa.AsAsker(), "animal", "dog", "1", func() error { return nil })
19 })
20
21 qa.ExpectQuestion(t, &survey.Input{
22 Message: `You are about to delete the animal "dog" (1). This action cannot be reversed. To confirm, type the animal name:`,
23 }).AnswerWith("dog")
24
25 err := <-errReceiver
26 assert.Nil(t, err)
27}
28
29func TestQuestion_DeleteWithConfirmation_invalidResponse(t *testing.T) {
30 qa := testutil.NewAskMocker()

Callers

nothing calls this directly

Calls 6

AsAskerMethod · 0.95
ExpectQuestionMethod · 0.95
NewAskMockerFunction · 0.92
GoBeginFunction · 0.92
DeleteWithConfirmationFunction · 0.92
AnswerWithMethod · 0.80

Tested by

no test coverage detected