本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/organizations/fakes.FakeOrganizationRepository类的典型用法代码示例。如果您正苦于以下问题:Golang FakeOrganizationRepository类的具体用法?Golang FakeOrganizationRepository怎么用?Golang FakeOrganizationRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeOrganizationRepository类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1:
. "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("target command", func() {
var (
orgRepo *fake_org.FakeOrganizationRepository
spaceRepo *testapi.FakeSpaceRepository
requirementsFactory *testreq.FakeReqFactory
config core_config.Repository
ui *testterm.FakeUI
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = config
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("target").SetDependency(deps, pluginCall))
}
listSpacesStub := func(spaces []models.Space) func(func(models.Space) bool) error {
return func(cb func(models.Space) bool) error {
var keepGoing bool
开发者ID:vframbach,项目名称:cli,代码行数:32,代码来源:target_test.go
示例2:
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("delete-org command", func() {
var (
config core_config.ReadWriter
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
orgRepo *test_org.FakeOrganizationRepository
org models.Organization
)
BeforeEach(func() {
ui = &testterm.FakeUI{
Inputs: []string{"y"},
}
config = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{}
org = models.Organization{}
org.Name = "org-to-delete"
org.Guid = "org-to-delete-guid"
orgRepo = &test_org.FakeOrganizationRepository{}
开发者ID:tools-alexuser01,项目名称:cli,代码行数:31,代码来源:delete_org_test.go
示例3:
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
开发者ID:0976254669,项目名称:cli,代码行数:31,代码来源:create_space_test.go
示例4:
. "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)
})
开发者ID:matanzit,项目名称:cli,代码行数:32,代码来源:create_quota_test.go
示例5:
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/securitygroup"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("bind-security-group command", func() {
var (
ui *testterm.FakeUI
cmd BindSecurityGroup
configRepo core_config.ReadWriter
fakeSecurityGroupRepo *testapi.FakeSecurityGroupRepo
requirementsFactory *testreq.FakeReqFactory
fakeSpaceRepo *fakes.FakeSpaceRepository
fakeOrgRepo *test_org.FakeOrganizationRepository
fakeSpaceBinder *zoidberg.FakeSecurityGroupSpaceBinder
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
fakeOrgRepo = &test_org.FakeOrganizationRepository{}
fakeSpaceRepo = &fakes.FakeSpaceRepository{}
requirementsFactory = &testreq.FakeReqFactory{}
fakeSecurityGroupRepo = &testapi.FakeSecurityGroupRepo{}
configRepo = testconfig.NewRepositoryWithDefaults()
fakeSpaceBinder = &zoidberg.FakeSecurityGroupSpaceBinder{}
cmd = NewBindSecurityGroup(ui, configRepo, fakeSecurityGroupRepo, fakeSpaceRepo, fakeOrgRepo, fakeSpaceBinder)
})
开发者ID:tools-alexuser01,项目名称:cli,代码行数:32,代码来源:bind_security_group_test.go
示例6:
var _ = Describe("Service Plans", func() {
var (
actor actors.ServicePlanActor
servicePlanRepo *testapi.FakeServicePlanRepo
servicePlanVisibilityRepo *testapi.FakeServicePlanVisibilityRepository
orgRepo *fake_orgs.FakeOrganizationRepository
planBuilder *fake_plan_builder.FakePlanBuilder
serviceBuilder *fake_service_builder.FakeServiceBuilder
privateServicePlanVisibilityFields models.ServicePlanVisibilityFields
publicServicePlanVisibilityFields models.ServicePlanVisibilityFields
limitedServicePlanVisibilityFields models.ServicePlanVisibilityFields
publicServicePlan models.ServicePlanFields
privateServicePlan models.ServicePlanFields
limitedServicePlan models.ServicePlanFields
publicService models.ServiceOffering
mixedService models.ServiceOffering
privateService models.ServiceOffering
publicAndLimitedService models.ServiceOffering
org1 models.Organization
org2 models.Organization
visibility1 models.ServicePlanVisibilityFields
)
BeforeEach(func() {
开发者ID:vframbach,项目名称:cli,代码行数:31,代码来源:services_plans_test.go
示例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/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("rename-org command", func() {
var (
requirementsFactory *testreq.FakeReqFactory
orgRepo *test_org.FakeOrganizationRepository
ui *testterm.FakeUI
configRepo core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("rename-org").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
requirementsFactory = &testreq.FakeReqFactory{}
orgRepo = &test_org.FakeOrganizationRepository{}
ui = new(testterm.FakeUI)
开发者ID:vframbach,项目名称:cli,代码行数:31,代码来源:rename_org_test.go
示例8:
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)
开发者ID:vframbach,项目名称:cli,代码行数:31,代码来源:create_org_test.go
示例9:
"github.com/cloudfoundry/cli/cf/configuration"
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
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{}
orgRepo = &test_org.FakeOrganizationRepository{}
})
runCommand := func(args ...string) {
testcmd.RunCommand(NewCreateOrg(ui, config, orgRepo), args, requirementsFactory)
}
Describe("requirements", func() {
开发者ID:ramirito,项目名称:cli,代码行数:32,代码来源:create_org_test.go
示例10:
"github.com/cloudfoundry/cli/plugin/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("org command", func() {
var (
ui *testterm.FakeUI
orgRepo *test_org.FakeOrganizationRepository
configRepo core_config.Repository
requirementsFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("orgs").SetDependency(deps, pluginCall))
}
runCommand := func(args ...string) bool {
return testcmd.RunCliCommand("orgs", args, requirementsFactory, updateCommandDependency, false)
}
开发者ID:mandarjog,项目名称:cli,代码行数:30,代码来源:orgs_test.go
示例11:
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Login Command", func() {
var (
Flags []string
Config core_config.Repository
ui *testterm.FakeUI
authRepo *testapi.FakeAuthenticationRepository
endpointRepo *testapi.FakeEndpointRepo
orgRepo *fake_organizations.FakeOrganizationRepository
spaceRepo *testapi.FakeSpaceRepository
org models.Organization
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = Config
deps.RepoLocator = deps.RepoLocator.SetEndpointRepository(endpointRepo)
deps.RepoLocator = deps.RepoLocator.SetAuthenticationRepository(authRepo)
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("login").SetDependency(deps, pluginCall))
}
开发者ID:vframbach,项目名称:cli,代码行数:32,代码来源:login_test.go
示例12:
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)
}
开发者ID:matanzit,项目名称:cli,代码行数:31,代码来源:create_org_test.go
示例13:
"github.com/cloudfoundry/cli/cf/actors"
broker_builder "github.com/cloudfoundry/cli/cf/actors/broker_builder/fakes"
service_builder "github.com/cloudfoundry/cli/cf/actors/service_builder/fakes"
organization_fakes "github.com/cloudfoundry/cli/cf/api/organizations/fakes"
"github.com/cloudfoundry/cli/cf/errors"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Services", func() {
var (
actor actors.ServiceActor
brokerBuilder *broker_builder.FakeBrokerBuilder
serviceBuilder *service_builder.FakeServiceBuilder
orgRepo *organization_fakes.FakeOrganizationRepository
serviceBroker1 models.ServiceBroker
service1 models.ServiceOffering
)
BeforeEach(func() {
orgRepo = &organization_fakes.FakeOrganizationRepository{}
brokerBuilder = &broker_builder.FakeBrokerBuilder{}
serviceBuilder = &service_builder.FakeServiceBuilder{}
actor = actors.NewServiceHandler(orgRepo, brokerBuilder, serviceBuilder)
serviceBroker1 = models.ServiceBroker{Guid: "my-service-broker-guid1", Name: "my-service-broker1"}
service1 = models.ServiceOffering{ServiceOfferingFields: models.ServiceOfferingFields{
Label: "my-service1",
开发者ID:vframbach,项目名称:cli,代码行数:32,代码来源:services_test.go
示例14:
fakeBinder "github.com/cloudfoundry/cli/cf/api/security_groups/spaces/fakes"
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("unbind-security-group command", func() {
var (
ui *testterm.FakeUI
securityGroupRepo *fakeSecurityGroup.FakeSecurityGroupRepo
orgRepo *fake_org.FakeOrganizationRepository
spaceRepo *fakes.FakeSpaceRepository
secBinder *fakeBinder.FakeSecurityGroupSpaceBinder
requirementsFactory *testreq.FakeReqFactory
configRepo core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
deps.RepoLocator = deps.RepoLocator.SetSecurityGroupRepository(securityGroupRepo)
deps.RepoLocator = deps.RepoLocator.SetSecurityGroupSpaceBinder(secBinder)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("unbind-security-group").SetDependency(deps, pluginCall))
}
开发者ID:vframbach,项目名称:cli,代码行数:31,代码来源:unbind_security_group_test.go
示例15:
"github.com/cloudfoundry/cli/cf/configuration/core_config"
"github.com/cloudfoundry/cli/cf/errors"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CopySource", func() {
var (
ui *testterm.FakeUI
config core_config.ReadWriter
requirementsFactory *testreq.FakeReqFactory
authRepo *testapi.FakeAuthenticationRepository
appRepo *testApplication.FakeApplicationRepository
copyAppSourceRepo *testCopyApplication.FakeCopyApplicationSourceRepository
spaceRepo *testapi.FakeSpaceRepository
orgRepo *testorg.FakeOrganizationRepository
appRestarter *testcmd.FakeApplicationRestarter
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true}
authRepo = &testapi.FakeAuthenticationRepository{}
appRepo = &testApplication.FakeApplicationRepository{}
copyAppSourceRepo = &testCopyApplication.FakeCopyApplicationSourceRepository{}
spaceRepo = &testapi.FakeSpaceRepository{}
orgRepo = &testorg.FakeOrganizationRepository{}
appRestarter = &testcmd.FakeApplicationRestarter{}
开发者ID:tools-alexuser01,项目名称:cli,代码行数:31,代码来源:copy_source_test.go
示例16:
"github.com/cloudfoundry/cli/cf/actors/plan_builder"
"github.com/cloudfoundry/cli/cf/api/fakes"
testorg "github.com/cloudfoundry/cli/cf/api/organizations/fakes"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Plan builder", func() {
var (
builder plan_builder.PlanBuilder
planRepo *fakes.FakeServicePlanRepo
visibilityRepo *fakes.FakeServicePlanVisibilityRepository
orgRepo *testorg.FakeOrganizationRepository
plan1 models.ServicePlanFields
plan2 models.ServicePlanFields
org1 models.Organization
org2 models.Organization
)
BeforeEach(func() {
plan_builder.PlanToOrgsVisibilityMap = nil
plan_builder.OrgToPlansVisibilityMap = nil
planRepo = &fakes.FakeServicePlanRepo{}
visibilityRepo = &fakes.FakeServicePlanVisibilityRepository{}
orgRepo = &testorg.FakeOrganizationRepository{}
builder = plan_builder.NewBuilder(planRepo, visibilityRepo, orgRepo)
开发者ID:vframbach,项目名称:cli,代码行数:30,代码来源:plan_builder_test.go
注:本文中的github.com/cloudfoundry/cli/cf/api/organizations/fakes.FakeOrganizationRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论