本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/feature_flags/fakes.FakeFeatureFlagRepository类的典型用法代码示例。如果您正苦于以下问题:Golang FakeFeatureFlagRepository类的具体用法?Golang FakeFeatureFlagRepository怎么用?Golang FakeFeatureFlagRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeFeatureFlagRepository类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("UnsetOrgRole", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
userRepo *testapi.FakeUserRepository
flagRepo *fakefeatureflagsapi.FakeFeatureFlagRepository
cmd command_registry.Command
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
userRequirement *fakerequirements.FakeUserRequirement
organizationRequirement *fakerequirements.FakeOrganizationRequirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
userRepo = &testapi.FakeUserRepository{}
repoLocator := deps.RepoLocator.SetUserRepository(userRepo)
flagRepo = &fakefeatureflagsapi.FakeFeatureFlagRepository{}
repoLocator = repoLocator.SetFeatureFlagRepository(flagRepo)
示例2:
"github.com/cloudfoundry/cli/cf/command_registry"
"github.com/cloudfoundry/cli/cf/configuration/core_config"
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/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("disable-feature-flag command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
flagRepo *fakeflag.FakeFeatureFlagRepository
configRepo core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetFeatureFlagRepository(flagRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("disable-feature-flag").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
示例3:
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("set-space-role command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
spaceRepo *testapi.FakeSpaceRepository
userRepo *testapi.FakeUserRepository
configRepo core_config.Repository
flagRepo *fakeflag.FakeFeatureFlagRepository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
deps.RepoLocator = deps.RepoLocator.SetUserRepository(userRepo)
deps.RepoLocator = deps.RepoLocator.SetFeatureFlagRepository(flagRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("set-space-role").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
示例4:
fakeflag "github.com/cloudfoundry/cli/cf/api/feature_flags/fakes"
. "github.com/cloudfoundry/cli/cf/commands/featureflag"
"github.com/cloudfoundry/cli/cf/models"
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/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("feature-flags command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
flagRepo *fakeflag.FakeFeatureFlagRepository
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
flagRepo = &fakeflag.FakeFeatureFlagRepository{}
})
runCommand := func(args ...string) bool {
cmd := NewListFeatureFlags(ui, testconfig.NewRepositoryWithDefaults(), flagRepo)
return testcmd.RunCommand(cmd, args, requirementsFactory)
}
Describe("requirements", func() {
示例5:
"github.com/cloudfoundry/cli/cf/configuration/core_config"
"github.com/cloudfoundry/cli/cf/models"
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/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("feature-flag command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
configRepo core_config.Repository
flagRepo *fakeflag.FakeFeatureFlagRepository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetFeatureFlagRepository(flagRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("feature-flag").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
示例6:
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/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("create-org command", func() {
var (
config core_config.Repository
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
orgRepo *test_org.FakeOrganizationRepository
quotaRepo *test_quota.FakeQuotaRepository
deps command_registry.Dependency
orgRoleSetter *userCmdFakes.FakeOrgRoleSetter
flagRepo *fakeflag.FakeFeatureFlagRepository
OriginalCommand command_registry.Command
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
deps.RepoLocator = deps.RepoLocator.SetQuotaRepository(quotaRepo)
deps.RepoLocator = deps.RepoLocator.SetFeatureFlagRepository(flagRepo)
deps.Config = config
//inject fake 'command dependency' into registry
command_registry.Register(orgRoleSetter)