本文整理匯總了Golang中code/cloudfoundry/org/cli/cf/api/apifakes.FakeRouteRepository類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeRouteRepository類的具體用法?Golang FakeRouteRepository怎麽用?Golang FakeRouteRepository使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeRouteRepository類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
"code.cloudfoundry.org/cli/cf/terminal"
testcmd "code.cloudfoundry.org/cli/testhelpers/commands"
testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"code.cloudfoundry.org/cli/cf/commands/route"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
)
var _ = Describe("routes command", func() {
var (
ui *testterm.FakeUI
routeRepo *apifakes.FakeRouteRepository
domainRepo *apifakes.FakeDomainRepository
configRepo coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo).SetDomainRepository(domainRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("routes").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
示例2:
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("DeleteRoute", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
routeRepo *apifakes.FakeRouteRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
domainRequirement *requirementsfakes.FakeDomainRequirement
minAPIVersionRequirement requirements.Requirement
fakeDomain models.DomainFields
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = new(apifakes.FakeRouteRepository)
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
示例3:
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CheckRoute", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
routeRepo *apifakes.FakeRouteRepository
domainRepo *apifakes.FakeDomainRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedOrgRequirement *requirementsfakes.FakeTargetedOrgRequirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = new(apifakes.FakeRouteRepository)
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
示例4:
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CreateRoute", func() {
var (
ui *testterm.FakeUI
routeRepo *apifakes.FakeRouteRepository
configRepo coreconfig.Repository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
spaceRequirement *requirementsfakes.FakeSpaceRequirement
domainRequirement *requirementsfakes.FakeDomainRequirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = new(apifakes.FakeRouteRepository)
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
deps = commandregistry.Dependency{
UI: ui,
示例5:
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("UnmapRoute", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
routeRepo *apifakes.FakeRouteRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
applicationRequirement *requirementsfakes.FakeApplicationRequirement
domainRequirement *requirementsfakes.FakeDomainRequirement
minAPIVersionRequirement requirements.Requirement
fakeDomain models.DomainFields
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = new(apifakes.FakeRouteRepository)
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
示例6:
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("UnbindRouteService", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
routeRepo *apifakes.FakeRouteRepository
routeServiceBindingRepo *apifakes.FakeRouteServiceBindingRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
fakeDomain models.DomainFields
loginRequirement requirements.Requirement
minAPIVersionRequirement requirements.Requirement
domainRequirement *requirementsfakes.FakeDomainRequirement
serviceInstanceRequirement *requirementsfakes.FakeServiceInstanceRequirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = new(apifakes.FakeRouteRepository)
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
示例7:
testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
"code.cloudfoundry.org/cli/cf/commandregistry"
"code.cloudfoundry.org/cli/cf/commands/route"
"code.cloudfoundry.org/cli/cf/configuration/coreconfig"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("delete-orphaned-routes command", func() {
var (
ui *testterm.FakeUI
routeRepo *apifakes.FakeRouteRepository
configRepo coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("delete-orphaned-routes").SetDependency(deps, pluginCall))
}
callDeleteOrphanedRoutes := func(confirmation string, args []string, requirementsFactory *requirementsfakes.FakeFactory, routeRepo *apifakes.FakeRouteRepository) (*testterm.FakeUI, bool) {
ui = &testterm.FakeUI{Inputs: []string{confirmation}}
configRepo = testconfig.NewRepositoryWithDefaults()
passed := testcmd.RunCLICommand("delete-orphaned-routes", args, requirementsFactory, updateCommandDependency, false, ui)
示例8:
"code.cloudfoundry.org/cli/cf/api/apifakes"
cferrors "code.cloudfoundry.org/cli/cf/errors"
"code.cloudfoundry.org/cli/cf/errors/errorsfakes"
"code.cloudfoundry.org/cli/cf/models"
"code.cloudfoundry.org/cli/cf/terminal/terminalfakes"
"code.cloudfoundry.org/cli/utils/words/generator/generatorfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Routes", func() {
var (
fakeUI *terminalfakes.FakeUI
fakeRouteRepository *apifakes.FakeRouteRepository
fakeDomainRepository *apifakes.FakeDomainRepository
routeActor RouteActor
expectedRoute models.Route
expectedDomain models.DomainFields
wordGenerator *generatorfakes.FakeWordGenerator
)
BeforeEach(func() {
fakeUI = &terminalfakes.FakeUI{}
fakeRouteRepository = new(apifakes.FakeRouteRepository)
fakeDomainRepository = new(apifakes.FakeDomainRepository)
routeActor = NewRouteActor(fakeUI, fakeRouteRepository, fakeDomainRepository)
wordGenerator = new(generatorfakes.FakeWordGenerator)
})
Describe("CreateRandomTCPRoute", func() {
BeforeEach(func() {
示例9:
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("MapRoute", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
routeRepo *apifakes.FakeRouteRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
applicationRequirement *requirementsfakes.FakeApplicationRequirement
domainRequirement *requirementsfakes.FakeDomainRequirement
minAPIVersionRequirement requirements.Requirement
diegoApplicationRequirement *requirementsfakes.FakeDiegoApplicationRequirement
originalCreateRouteCmd commandregistry.Command
fakeCreateRouteCmd commandregistry.Command
fakeDomain models.DomainFields
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = new(apifakes.FakeRouteRepository)
示例10:
"code.cloudfoundry.org/cli/cf/requirements/requirementsfakes"
testcmd "code.cloudfoundry.org/cli/testhelpers/commands"
testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "code.cloudfoundry.org/cli/testhelpers/matchers"
)
var _ = Describe("delete app command", func() {
var (
ui *testterm.FakeUI
app models.Application
configRepo coreconfig.Repository
appRepo *applicationsfakes.FakeRepository
routeRepo *apifakes.FakeRouteRepository
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("delete").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
app = models.Application{}