本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/api/fakes.FakeAuthTokenRepo類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeAuthTokenRepo類的具體用法?Golang FakeAuthTokenRepo怎麽用?Golang FakeAuthTokenRepo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeAuthTokenRepo類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: callListServiceAuthTokens
func callListServiceAuthTokens(requirementsFactory *testreq.FakeReqFactory, authTokenRepo *testapi.FakeAuthTokenRepo) (ui *testterm.FakeUI) {
ui = &testterm.FakeUI{}
config := testconfig.NewRepositoryWithDefaults()
cmd := NewListServiceAuthTokens(ui, config, authTokenRepo)
testcmd.RunCommand(cmd, []string{}, requirementsFactory)
return
}
var _ = Describe("service-auth-tokens command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.ReadWriter
authTokenRepo *testapi.FakeAuthTokenRepo
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{Inputs: []string{"y"}}
authTokenRepo = &testapi.FakeAuthTokenRepo{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{}
})
runCommand := func(args ...string) bool {
return testcmd.RunCommand(NewListServiceAuthTokens(ui, configRepo, authTokenRepo), args, requirementsFactory)
}
Describe("requirements", func() {
示例2:
"github.com/cloudfoundry/cli/cf/models"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/cf/commands/serviceauthtoken"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("update-service-auth-token command", func() {
var (
ui *testterm.FakeUI
configRepo configuration.ReadWriter
authTokenRepo *testapi.FakeAuthTokenRepo
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{Inputs: []string{"y"}}
authTokenRepo = &testapi.FakeAuthTokenRepo{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{}
})
runCommand := func(args ...string) {
testcmd.RunCommand(NewUpdateServiceAuthToken(ui, configRepo, authTokenRepo), args, requirementsFactory)
}
Describe("requirements", func() {
示例3:
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("delete-service-auth-token command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
authTokenRepo *testapi.FakeAuthTokenRepo
requirementsFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetServiceAuthTokenRepository(authTokenRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete-service-auth-token").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{Inputs: []string{"y"}}
authTokenRepo = &testapi.FakeAuthTokenRepo{}
configRepo = testconfig.NewRepositoryWithDefaults()