本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/actors/plan_builder/fakes.FakePlanBuilder类的典型用法代码示例。如果您正苦于以下问题:Golang FakePlanBuilder类的具体用法?Golang FakePlanBuilder怎么用?Golang FakePlanBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakePlanBuilder类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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/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{}
示例2:
"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.FakeServiceRepo
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.FakeServiceRepo{}
planBuilder = &plan_builder_fakes.FakePlanBuilder{}
serviceBuilder = service_builder.NewBuilder(serviceRepo, planBuilder)
service1 = models.ServiceOffering{
ServiceOfferingFields: models.ServiceOfferingFields{
Label: "my-service1",
Guid: "service-guid1",
示例3:
import (
plan_builder_fakes "github.com/cloudfoundry/cli/cf/actors/plan_builder/fakes"
"github.com/cloudfoundry/cli/cf/actors/service_builder"
"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 *fakes.FakeServiceRepo
service1 models.ServiceOffering
plan1 models.ServicePlanFields
plan2 models.ServicePlanFields
)
BeforeEach(func() {
serviceRepo = &fakes.FakeServiceRepo{}
planBuilder = &plan_builder_fakes.FakePlanBuilder{}
serviceBuilder = service_builder.NewBuilder(serviceRepo, planBuilder)
service1 = models.ServiceOffering{
ServiceOfferingFields: models.ServiceOfferingFields{
Label: "my-service1",
Guid: "service-guid1",
BrokerGuid: "my-service-broker-guid1",
},