本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/fakes.FakeServiceRepository类的典型用法代码示例。如果您正苦于以下问题:Golang FakeServiceRepository类的具体用法?Golang FakeServiceRepository怎么用?Golang FakeServiceRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeServiceRepository类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1:
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("service-keys command", func() {
var (
ui *testterm.FakeUI
config core_config.Repository
requirementsFactory *testreq.FakeReqFactory
serviceRepo *testapi.FakeServiceRepository
serviceKeyRepo *testapi.FakeServiceKeyRepo
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.RepoLocator = deps.RepoLocator.SetServiceKeyRepository(serviceKeyRepo)
deps.Config = config
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("service-keys").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
开发者ID:vframbach,项目名称:cli,代码行数:32,代码来源:service_keys_test.go
示例2:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Push Command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
manifestRepo *testmanifest.FakeManifestRepository
starter *appCmdFakes.FakeApplicationStarter
stopper *appCmdFakes.FakeApplicationStopper
serviceBinder *serviceCmdFakes.FakeAppBinder
appRepo *testApplication.FakeApplicationRepository
domainRepo *testapi.FakeDomainRepository
routeRepo *testapi.FakeRouteRepository
stackRepo *testStacks.FakeStackRepository
serviceRepo *testapi.FakeServiceRepository
wordGenerator *testwords.FakeWordGenerator
requirementsFactory *testreq.FakeReqFactory
authRepo *testapi.FakeAuthenticationRepository
actor *fakeactors.FakePushActor
appfiles *fakeappfiles.FakeAppFiles
zipper *fakeappfiles.FakeZipper
OriginalCommandStart command_registry.Command
OriginalCommandStop command_registry.Command
OriginalCommandServiceBind command_registry.Command
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
开发者ID:Doebe,项目名称:workplace,代码行数:31,代码来源:push_test.go
示例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("update-service command", func() {
var (
ui *testterm.FakeUI
config core_config.Repository
requirementsFactory *testreq.FakeReqFactory
serviceRepo *testapi.FakeServiceRepository
planBuilder *testplanbuilder.FakePlanBuilder
offering1 models.ServiceOffering
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = config
deps.PlanBuilder = planBuilder
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("update-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
开发者ID:vframbach,项目名称:cli,代码行数:31,代码来源:update_service_test.go
示例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/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("delete-service-key command", func() {
var (
ui *testterm.FakeUI
config core_config.Repository
requirementsFactory *testreq.FakeReqFactory
serviceRepo *testapi.FakeServiceRepository
serviceKeyRepo *testapi.FakeServiceKeyRepo
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.RepoLocator = deps.RepoLocator.SetServiceKeyRepository(serviceKeyRepo)
deps.Config = config
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete-service-key").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
开发者ID:vframbach,项目名称:cli,代码行数:32,代码来源:delete_service_key_test.go
示例5:
"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("rename-service command", func() {
var (
ui *testterm.FakeUI
config core_config.Repository
serviceRepo *testapi.FakeServiceRepository
requirementsFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = config
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("rename-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
serviceRepo = &testapi.FakeServiceRepository{}
开发者ID:vframbach,项目名称:cli,代码行数:31,代码来源:rename_service_test.go
示例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/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("delete-service command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
serviceRepo *testapi.FakeServiceRepository
serviceInstance models.ServiceInstance
configRepo core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{
Inputs: []string{"yes"},
}
开发者ID:vframbach,项目名称:cli,代码行数:32,代码来源:delete_service_test.go
示例7:
"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"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("migrating service instances from v1 to v2", func() {
var (
ui *testterm.FakeUI
serviceRepo *testapi.FakeServiceRepository
config core_config.Repository
requirementsFactory *testreq.FakeReqFactory
args []string
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = config
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("migrate-service-instances").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepository()
serviceRepo = &testapi.FakeServiceRepository{}
开发者ID:prysmakou,项目名称:cli,代码行数:32,代码来源:migrate_service_instances_test.go
示例8:
"github.com/cloudfoundry/cli/cf/actors/service_builder"
testapi "github.com/cloudfoundry/cli/cf/api/fakes"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Service Builder", func() {
var (
planBuilder *plan_builder_fakes.FakePlanBuilder
serviceBuilder service_builder.ServiceBuilder
serviceRepo *testapi.FakeServiceRepository
service1 models.ServiceOffering
service2 models.ServiceOffering
v1Service models.ServiceOffering
planWithoutOrgs models.ServicePlanFields
plan1 models.ServicePlanFields
plan2 models.ServicePlanFields
plan3 models.ServicePlanFields
)
BeforeEach(func() {
serviceRepo = &testapi.FakeServiceRepository{}
planBuilder = &plan_builder_fakes.FakePlanBuilder{}
serviceBuilder = service_builder.NewBuilder(serviceRepo, planBuilder)
service1 = models.ServiceOffering{
ServiceOfferingFields: models.ServiceOfferingFields{
Label: "my-service1",
Guid: "service-guid1",
开发者ID:vframbach,项目名称:cli,代码行数:32,代码来源:service_builder_test.go
示例9:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("PurgeServiceInstance", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
serviceRepo *fakeapi.FakeServiceRepository
cmd command_registry.Command
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
ui.InputsChan = make(chan string)
configRepo = testconfig.NewRepositoryWithDefaults()
serviceRepo = &fakeapi.FakeServiceRepository{}
repoLocator := deps.RepoLocator.SetServiceRepository(serviceRepo)
deps = command_registry.Dependency{
开发者ID:chavdarch,项目名称:cli,代码行数:31,代码来源:purge_service_instance_test.go
示例10:
"github.com/cloudfoundry/cli/cf/command_registry"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("create-service command", func() {
var (
ui *testterm.FakeUI
config core_config.Repository
requirementsFactory *testreq.FakeReqFactory
serviceRepo *testapi.FakeServiceRepository
serviceBuilder *fakes.FakeServiceBuilder
offering1 models.ServiceOffering
offering2 models.ServiceOffering
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = config
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.ServiceBuilder = serviceBuilder
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("create-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
开发者ID:vframbach,项目名称:cli,代码行数:30,代码来源:create_service_test.go
示例11:
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
"github.com/cloudfoundry/cli/testhelpers/maker"
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("purge-service-offering command", func() {
var (
requirementsFactory *testreq.FakeReqFactory
config core_config.Repository
ui *testterm.FakeUI
serviceRepo *testapi.FakeServiceRepository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = config
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("purge-service-offering").SetDependency(deps, pluginCall))
}
runCommand := func(args []string) bool {
return testcmd.RunCliCommand("purge-service-offering", args, requirementsFactory, updateCommandDependency, false)
}
开发者ID:vframbach,项目名称:cli,代码行数:30,代码来源:purge_service_offering_test.go
示例12:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("PurgeServiceOffering", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
serviceRepo *testapi.FakeServiceRepository
cmd command_registry.Command
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
maxAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
serviceRepo = &testapi.FakeServiceRepository{}
repoLocator := deps.RepoLocator.SetServiceRepository(serviceRepo)
deps = command_registry.Dependency{
Ui: ui,
开发者ID:jmcabandara,项目名称:cli,代码行数:31,代码来源:purge_service_offering_test.go
注:本文中的github.com/cloudfoundry/cli/cf/api/fakes.FakeServiceRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论