Esempio n. 1
0
func TestStacks(t *testing.T) {
	stack1 := cf.Stack{}
	stack1.Name = "Stack-1"
	stack1.Description = "Stack 1 Description"

	stack2 := cf.Stack{}
	stack2.Name = "Stack-2"
	stack2.Description = "Stack 2 Description"

	stackRepo := &testapi.FakeStackRepository{
		FindAllStacks: []cf.Stack{stack1, stack2},
	}

	ui := callStacks(t, stackRepo)

	assert.Equal(t, len(ui.Outputs), 6)
	testassert.SliceContains(t, ui.Outputs, testassert.Lines{
		{"Getting stacks in org", "my-org", "my-space", "my-user"},
		{"OK"},
		{"Stack-1", "Stack 1 Description"},
		{"Stack-2", "Stack 2 Description"},
	})
}