本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/api/fakes.FakeServicePlanRepo類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeServicePlanRepo類的具體用法?Golang FakeServicePlanRepo怎麽用?Golang FakeServicePlanRepo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeServicePlanRepo類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
package actors_test
import (
"github.com/cloudfoundry/cli/cf/actors"
"github.com/cloudfoundry/cli/cf/api/fakes"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Services", func() {
var (
actor actors.ServiceActor
brokerRepo *fakes.FakeServiceBrokerRepo
serviceRepo *fakes.FakeServiceRepo
servicePlanRepo *fakes.FakeServicePlanRepo
servicePlanVisibilityRepo *fakes.FakeServicePlanVisibilityRepository
orgRepo *fakes.FakeOrgRepository
)
BeforeEach(func() {
brokerRepo = &fakes.FakeServiceBrokerRepo{}
serviceRepo = &fakes.FakeServiceRepo{}
servicePlanRepo = &fakes.FakeServicePlanRepo{}
servicePlanVisibilityRepo = &fakes.FakeServicePlanVisibilityRepository{}
orgRepo = &fakes.FakeOrgRepository{}
actor = actors.NewServiceHandler(brokerRepo, serviceRepo, servicePlanRepo, servicePlanVisibilityRepo, orgRepo)
serviceBroker1 := models.ServiceBroker{Guid: "my-service-broker-guid", Name: "my-service-broker"}
serviceBroker2 := models.ServiceBroker{Guid: "my-service-broker-guid2", Name: "my-service-broker2"}
示例2:
"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() {
planRepo = &fakes.FakeServicePlanRepo{}
visibilityRepo = &fakes.FakeServicePlanVisibilityRepository{}
orgRepo = &testorg.FakeOrganizationRepository{}
builder = plan_builder.NewBuilder(planRepo, visibilityRepo, orgRepo)
plan1 = models.ServicePlanFields{
示例3:
import (
"github.com/cloudfoundry/cli/cf/actors"
"github.com/cloudfoundry/cli/cf/api/fakes"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Services", func() {
var (
actor actors.ServiceActor
brokerRepo *fakes.FakeServiceBrokerRepo
serviceRepo *fakes.FakeServiceRepo
servicePlanRepo *fakes.FakeServicePlanRepo
servicePlanVisibilityRepo *fakes.FakeServicePlanVisibilityRepository
orgRepo *fakes.FakeOrgRepository
serviceBroker1 models.ServiceBroker
serviceBroker2 models.ServiceBroker
)
BeforeEach(func() {
brokerRepo = &fakes.FakeServiceBrokerRepo{}
serviceRepo = &fakes.FakeServiceRepo{}
servicePlanRepo = &fakes.FakeServicePlanRepo{}
servicePlanVisibilityRepo = &fakes.FakeServicePlanVisibilityRepository{}
orgRepo = &fakes.FakeOrgRepository{}
actor = actors.NewServiceHandler(brokerRepo, serviceRepo, servicePlanRepo, servicePlanVisibilityRepo, orgRepo)
serviceBroker1 = models.ServiceBroker{Guid: "my-service-broker-guid", Name: "my-service-broker"}
示例4:
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() {
示例5:
"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)