本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/api/space_quotas/fakes.FakeSpaceQuotaRepository類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeSpaceQuotaRepository類的具體用法?Golang FakeSpaceQuotaRepository怎麽用?Golang FakeSpaceQuotaRepository使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeSpaceQuotaRepository類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
"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("unset-space-quota command", func() {
var (
ui *testterm.FakeUI
quotaRepo *fakes.FakeSpaceQuotaRepository
spaceRepo *testapi.FakeSpaceRepository
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.SetSpaceQuotaRepository(quotaRepo)
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("unset-space-quota").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
示例2:
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
test_org "github.com/cloudfoundry/cli/cf/api/organizations/fakes"
"github.com/cloudfoundry/cli/cf/api/space_quotas/fakes"
"github.com/cloudfoundry/cli/cf/errors"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
"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.FakeSpaceQuotaRepository
orgRepo *test_org.FakeOrganizationRepository
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
quotaRepo = &fakes.FakeSpaceQuotaRepository{}
orgRepo = &test_org.FakeOrganizationRepository{}
requirementsFactory = &testreq.FakeReqFactory{}
org := models.Organization{}
org.Name = "my-org"
org.Guid = "my-org-guid"
orgRepo.ListOrgsReturns([]models.Organization{org}, nil)
orgRepo.FindByNameReturns(org, nil)
})
示例3:
"github.com/cloudfoundry/cli/cf/configuration"
"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/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("space command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
quotaRepo *fakes.FakeSpaceQuotaRepository
configRepo configuration.ReadWriter
)
BeforeEach(func() {
configRepo = testconfig.NewRepositoryWithDefaults()
quotaRepo = &fakes.FakeSpaceQuotaRepository{}
ui = &testterm.FakeUI{}
requirementsFactory = &testreq.FakeReqFactory{}
})
runCommand := func(args ...string) {
testcmd.RunCommand(NewShowSpace(ui, configRepo, quotaRepo), args, requirementsFactory)
}
Describe("requirements", func() {
示例4:
"github.com/cloudfoundry/cli/cf/errors"
"github.com/cloudfoundry/cli/cf/models"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
"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/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("update-space-quota command", func() {
var (
ui *testterm.FakeUI
quotaRepo *fakes.FakeSpaceQuotaRepository
requirementsFactory *testreq.FakeReqFactory
quota models.SpaceQuota
quotaPaidService models.SpaceQuota
)
runCommand := func(args ...string) bool {
cmd := NewUpdateSpaceQuota(ui, configuration.NewRepositoryWithDefaults(), quotaRepo)
return testcmd.RunCommand(cmd, args, requirementsFactory)
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
quotaRepo = &fakes.FakeSpaceQuotaRepository{}
requirementsFactory = &testreq.FakeReqFactory{}
})
示例5:
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("create-space command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
configSpace models.SpaceFields
configOrg models.OrganizationFields
configRepo core_config.Repository
spaceRepo *testapi.FakeSpaceRepository
orgRepo *fake_org.FakeOrganizationRepository
userRepo *testapi.FakeUserRepository
spaceRoleSetter user.SpaceRoleSetter
spaceQuotaRepo *fakes.FakeSpaceQuotaRepository
OriginalCommand command_registry.Command
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
deps.RepoLocator = deps.RepoLocator.SetSpaceQuotaRepository(spaceQuotaRepo)
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
deps.RepoLocator = deps.RepoLocator.SetUserRepository(userRepo)
deps.Config = configRepo
示例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/spacequota"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("set-space-quota command", func() {
var (
ui *testterm.FakeUI
spaceRepo *fakes.FakeSpaceRepository
quotaRepo *quotafakes.FakeSpaceQuotaRepository
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
spaceRepo = &fakes.FakeSpaceRepository{}
quotaRepo = "afakes.FakeSpaceQuotaRepository{}
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
})
runCommand := func(args ...string) bool {
cmd := NewSetSpaceQuota(ui, testconfig.NewRepositoryWithDefaults(), spaceRepo, quotaRepo)
return testcmd.RunCommand(cmd, args, requirementsFactory)
}
示例7:
"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/spacequota"
. "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.FakeSpaceQuotaRepository
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
quotaRepo = &fakes.FakeSpaceQuotaRepository{}
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
})
runCommand := func(args ...string) bool {
cmd := NewListSpaceQuotas(ui, testconfig.NewRepositoryWithDefaults(), quotaRepo)
return testcmd.RunCommand(cmd, args, requirementsFactory)
}
Describe("requirements", func() {
示例8:
"github.com/cloudfoundry/cli/cf/models"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
"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/spacequota"
. "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.FakeSpaceQuotaRepository
orgRepo *test_org.FakeOrganizationRepository
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
quotaRepo = &fakes.FakeSpaceQuotaRepository{}
orgRepo = &test_org.FakeOrganizationRepository{}
requirementsFactory = &testreq.FakeReqFactory{}
org := models.Organization{}
org.Name = "my-org"
org.Guid = "my-org-guid"
orgRepo.ListOrgsReturns([]models.Organization{org}, nil)
orgRepo.FindByNameReturns(org, nil)
})
示例9:
"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/spacequota"
. "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.FakeSpaceQuotaRepository
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
quotaRepo = &fakes.FakeSpaceQuotaRepository{}
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
})
runCommand := func(args ...string) bool {
cmd := NewSpaceQuota(ui, testconfig.NewRepositoryWithDefaults(), quotaRepo)
return testcmd.RunCommand(cmd, args, requirementsFactory)
}
Describe("requirements", func() {
示例10:
"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/spacequota"
. "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.FakeSpaceQuotaRepository
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
quotaRepo = &fakes.FakeSpaceQuotaRepository{}
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
})
runCommand := func() bool {
cmd := NewListSpaceQuotas(ui, testconfig.NewRepositoryWithDefaults(), quotaRepo)
return testcmd.RunCommand(cmd, []string{}, requirementsFactory)
}
Describe("requirements", func() {