本文整理匯總了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",
},