本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/api/quotas/fakes.FakeQuotaRepository類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeQuotaRepository類的具體用法?Golang FakeQuotaRepository怎麽用?Golang FakeQuotaRepository使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeQuotaRepository類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/api/quotas/fakes"
"github.com/cloudfoundry/cli/cf/errors"
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"
)
var _ = Describe("create-quota command", func() {
var (
ui *testterm.FakeUI
quotaRepo *fakes.FakeQuotaRepository
requirementsFactory *testreq.FakeReqFactory
configRepo core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetQuotaRepository(quotaRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("create-quota").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
quotaRepo = &fakes.FakeQuotaRepository{}
示例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/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("set-quota command", func() {
var (
ui *testterm.FakeUI
quotaRepo *fakes.FakeQuotaRepository
requirementsFactory *testreq.FakeReqFactory
configRepo core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetQuotaRepository(quotaRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("set-quota").SetDependency(deps, pluginCall))
}
runCommand := func(args ...string) bool {
return testcmd.RunCliCommand("set-quota", args, requirementsFactory, updateCommandDependency, false)
}
示例3:
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("app Command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
quotaRepo *fakes.FakeQuotaRepository
quota models.QuotaFields
configRepo core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetQuotaRepository(quotaRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("update-quota").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
示例4:
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/command_registry"
"github.com/cloudfoundry/cli/cf/configuration/core_config"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("delete-quota command", func() {
var (
ui *testterm.FakeUI
quotaRepo *fakes.FakeQuotaRepository
requirementsFactory *testreq.FakeReqFactory
configRepo core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetQuotaRepository(quotaRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete-quota").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
quotaRepo = &fakes.FakeQuotaRepository{}
示例5:
"github.com/cloudfoundry/cli/cf/api/quotas/fakes"
. "github.com/cloudfoundry/cli/cf/commands/quota"
"github.com/cloudfoundry/cli/cf/errors"
"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/testhelpers/matchers"
)
var _ = Describe("quota", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
quotaRepo *fakes.FakeQuotaRepository
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
requirementsFactory = &testreq.FakeReqFactory{}
quotaRepo = &fakes.FakeQuotaRepository{}
})
runCommand := func(args ...string) {
cmd := NewShowQuota(ui, testconfig.NewRepositoryWithDefaults(), quotaRepo)
testcmd.RunCommand(cmd, args, requirementsFactory)
}
Context("When not logged in", func() {
示例6:
"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/quota"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("quotas command", func() {
var (
ui *testterm.FakeUI
quotaRepo *fakes.FakeQuotaRepository
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
quotaRepo = &fakes.FakeQuotaRepository{}
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
})
runCommand := func() bool {
cmd := NewListQuotas(ui, testconfig.NewRepositoryWithDefaults(), quotaRepo)
return testcmd.RunCommand(cmd, []string{}, requirementsFactory)
}
Describe("requirements", func() {
示例7:
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/organization"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("create-org command", func() {
var (
config configuration.ReadWriter
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
orgRepo *test_org.FakeOrganizationRepository
quotaRepo *test_quota.FakeQuotaRepository
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{}
orgRepo = &test_org.FakeOrganizationRepository{}
quotaRepo = &test_quota.FakeQuotaRepository{}
})
runCommand := func(args ...string) {
testcmd.RunCommand(NewCreateOrg(ui, config, orgRepo, quotaRepo), args, requirementsFactory)
}