本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/apifakes.FakeServiceRepository类的典型用法代码示例。如果您正苦于以下问题:Golang FakeServiceRepository类的具体用法?Golang FakeServiceRepository怎么用?Golang FakeServiceRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeServiceRepository类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1:
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/commandregistry"
. "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 coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
serviceRepo *apifakes.FakeServiceRepository
serviceKeyRepo *apifakes.OldFakeServiceKeyRepo
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.RepoLocator = deps.RepoLocator.SetServiceKeyRepository(serviceKeyRepo)
deps.Config = config
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("delete-service-key").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
开发者ID:Reejoshi,项目名称:cli,代码行数:32,代码来源:delete_service_key_test.go
示例2:
"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 *apifakes.FakeServiceRepository
config coreconfig.Repository
requirementsFactory *testreq.FakeReqFactory
args []string
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = config
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("migrate-service-instances").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepository()
serviceRepo = new(apifakes.FakeServiceRepository)
开发者ID:yingkitw,项目名称:cli,代码行数:32,代码来源:migrate_service_instances_test.go
示例3:
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/cf/commands/service"
"github.com/cloudfoundry/cli/cf/flags"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("update-service command", func() {
var (
ui *testterm.FakeUI
config coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
serviceRepo *apifakes.FakeServiceRepository
planBuilder *planbuilderfakes.FakePlanBuilder
offering1 models.ServiceOffering
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = config
deps.PlanBuilder = planBuilder
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("update-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
开发者ID:jasonkeene,项目名称:cli,代码行数:31,代码来源:update_service_test.go
示例4:
"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 *apifakes.FakeServiceRepository
serviceInstance models.ServiceInstance
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("delete-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{
Inputs: []string{"yes"},
}
开发者ID:yingkitw,项目名称:cli,代码行数:32,代码来源:delete_service_test.go
示例5:
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 coreconfig.Repository
serviceRepo *apifakes.FakeServiceRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
serviceRepo = new(apifakes.FakeServiceRepository)
repoLocator := deps.RepoLocator.SetServiceRepository(serviceRepo)
deps = commandregistry.Dependency{
UI: ui,
开发者ID:Reejoshi,项目名称:cli,代码行数:31,代码来源:purge_service_instance_test.go
示例6:
"github.com/cloudfoundry/cli/cf/commandregistry"
. "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 coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
serviceRepo *apifakes.FakeServiceRepository
serviceBuilder *servicebuilderfakes.FakeServiceBuilder
offering1 models.ServiceOffering
offering2 models.ServiceOffering
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = config
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.ServiceBuilder = serviceBuilder
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("create-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
开发者ID:Reejoshi,项目名称:cli,代码行数:30,代码来源:create_service_test.go
示例7:
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 coreconfig.Repository
serviceRepo *apifakes.FakeServiceRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
maxAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
serviceRepo = new(apifakes.FakeServiceRepository)
repoLocator := deps.RepoLocator.SetServiceRepository(serviceRepo)
deps = commandregistry.Dependency{
UI: ui,
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:purge_service_offering_test.go
示例8:
"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 coreconfig.Repository
serviceRepo *apifakes.FakeServiceRepository
requirementsFactory *testreq.FakeReqFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = config
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("rename-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
serviceRepo = new(apifakes.FakeServiceRepository)
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:rename_service_test.go
示例9:
"github.com/cloudfoundry/cli/cf/actors/servicebuilder"
"github.com/cloudfoundry/cli/cf/api/apifakes"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Service Builder", func() {
var (
planBuilder *planbuilderfakes.FakePlanBuilder
serviceBuilder servicebuilder.ServiceBuilder
serviceRepo *apifakes.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 = new(apifakes.FakeServiceRepository)
planBuilder = new(planbuilderfakes.FakePlanBuilder)
serviceBuilder = servicebuilder.NewBuilder(serviceRepo, planBuilder)
service1 = models.ServiceOffering{
ServiceOfferingFields: models.ServiceOfferingFields{
Label: "my-service1",
GUID: "service-guid1",
开发者ID:Reejoshi,项目名称:cli,代码行数:32,代码来源:service_builder_test.go
注:本文中的github.com/cloudfoundry/cli/cf/api/apifakes.FakeServiceRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论