本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/fakes.FakeRouteRepository类的典型用法代码示例。如果您正苦于以下问题:Golang FakeRouteRepository类的具体用法?Golang FakeRouteRepository怎么用?Golang FakeRouteRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeRouteRepository类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Execute
)
type passingRequirement struct{}
func (r passingRequirement) Execute() bool {
return true
}
var _ = Describe("CreateRoute", func() {
var (
ui *testterm.FakeUI
routeRepo *fakeapi.FakeRouteRepository
configRepo core_config.Repository
cmd route.CreateRoute
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
spaceRequirement *fakerequirements.FakeSpaceRequirement
domainRequirement *fakerequirements.FakeDomainRequirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = &fakeapi.FakeRouteRepository{}
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
deps = command_registry.Dependency{
Ui: ui,
开发者ID:juanpaulo,项目名称:cli,代码行数:32,代码来源:create_route_test.go
示例2:
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Push Command", func() {
var (
cmd *Push
ui *testterm.FakeUI
configRepo configuration.ReadWriter
manifestRepo *testmanifest.FakeManifestRepository
starter *testcmd.FakeAppStarter
stopper *testcmd.FakeAppStopper
serviceBinder *testcmd.FakeAppBinder
appRepo *testapi.FakeApplicationRepository
domainRepo *testapi.FakeDomainRepository
routeRepo *testapi.FakeRouteRepository
stackRepo *testapi.FakeStackRepository
serviceRepo *testapi.FakeServiceRepo
wordGenerator words.WordGenerator
requirementsFactory *testreq.FakeReqFactory
authRepo *testapi.FakeAuthenticationRepository
actor *fakeactors.FakePushActor
app_files *fakeappfiles.FakeAppFiles
zipper *fakeappfiles.FakeZipper
)
BeforeEach(func() {
manifestRepo = &testmanifest.FakeManifestRepository{}
starter = &testcmd.FakeAppStarter{}
stopper = &testcmd.FakeAppStopper{}
serviceBinder = &testcmd.FakeAppBinder{}
开发者ID:matanzit,项目名称:cli,代码行数:32,代码来源:push_test.go
示例3:
"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("routes command", func() {
var (
ui *testterm.FakeUI
routeRepo *testapi.FakeRouteRepository
configRepo core_config.Repository
requirementsFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("routes").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{
开发者ID:vframbach,项目名称:cli,代码行数:31,代码来源:routes_test.go
示例4:
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 app command", func() {
var (
ui *testterm.FakeUI
app models.Application
configRepo core_config.Repository
appRepo *testApplication.FakeApplicationRepository
routeRepo *testapi.FakeRouteRepository
requirementsFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
app = models.Application{}
开发者ID:vframbach,项目名称:cli,代码行数:31,代码来源:delete_test.go
示例5:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("MapRoute", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
routeRepo *fakeapi.FakeRouteRepository
cmd command_registry.Command
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
applicationRequirement *fakerequirements.FakeApplicationRequirement
domainRequirement *fakerequirements.FakeDomainRequirement
minAPIVersionRequirement requirements.Requirement
originalCreateRouteCmd command_registry.Command
fakeCreateRouteCmd command_registry.Command
fakeDomain models.DomainFields
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = &fakeapi.FakeRouteRepository{}
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
开发者ID:vframbach,项目名称:cli,代码行数:32,代码来源:map_route_test.go
示例6:
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/cf/command_registry"
"github.com/cloudfoundry/cli/cf/configuration/core_config"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("delete-orphaned-routes command", func() {
var (
ui *testterm.FakeUI
routeRepo *testapi.FakeRouteRepository
configRepo core_config.Repository
reqFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete-orphaned-routes").SetDependency(deps, pluginCall))
}
callDeleteOrphanedRoutes := func(confirmation string, args []string, reqFactory *testreq.FakeReqFactory, routeRepo *testapi.FakeRouteRepository) (*testterm.FakeUI, bool) {
ui = &testterm.FakeUI{Inputs: []string{confirmation}}
configRepo = testconfig.NewRepositoryWithDefaults()
passed := testcmd.RunCliCommand("delete-orphaned-routes", args, reqFactory, updateCommandDependency, false)
开发者ID:Doebe,项目名称:workplace,代码行数:31,代码来源:delete_orphaned_routes_test.go
示例7:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("BindRouteService", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
routeRepo *testapi.FakeRouteRepository
routeServiceBindingRepo *testapi.FakeRouteServiceBindingRepository
cmd command_registry.Command
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
fakeDomain models.DomainFields
loginRequirement requirements.Requirement
domainRequirement *fakerequirements.FakeDomainRequirement
serviceInstanceRequirement *fakerequirements.FakeServiceInstanceRequirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = &testapi.FakeRouteRepository{}
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
开发者ID:sunatthegilddotcom,项目名称:cli,代码行数:30,代码来源:bind_route_service_test.go
示例8:
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 app command", func() {
var (
cmd *DeleteApp
ui *testterm.FakeUI
app models.Application
configRepo configuration.ReadWriter
appRepo *testapi.FakeApplicationRepository
routeRepo *testapi.FakeRouteRepository
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
app = models.Application{}
app.Name = "app-to-delete"
app.Guid = "app-to-delete-guid"
ui = &testterm.FakeUI{}
appRepo = &testapi.FakeApplicationRepository{}
routeRepo = &testapi.FakeRouteRepository{}
requirementsFactory = &testreq.FakeReqFactory{}
开发者ID:BlueSpice,项目名称:cli,代码行数:30,代码来源:delete_test.go
示例9:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CheckRoute", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
routeRepo *fakeapi.FakeRouteRepository
domainRepo *fakeapi.FakeDomainRepository
cmd command_registry.Command
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedOrgRequirement *fakerequirements.FakeTargetedOrgRequirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = &fakeapi.FakeRouteRepository{}
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
开发者ID:digideskio,项目名称:cli,代码行数:30,代码来源:check_route_test.go
示例10:
"github.com/cloudfoundry/cli/cf/configuration/core_config"
"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("routes command", func() {
var (
ui *testterm.FakeUI
routeRepo *testapi.FakeRouteRepository
configRepo core_config.ReadWriter
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{
LoginSuccess: true,
TargetedSpaceSuccess: true,
}
routeRepo = &testapi.FakeRouteRepository{}
})
runCommand := func(args ...string) bool {
cmd := NewListRoutes(ui, configRepo, routeRepo)
开发者ID:tools-alexuser01,项目名称:cli,代码行数:32,代码来源:routes_test.go
示例11:
"github.com/cloudfoundry/cli/cf/configuration/core_config"
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("check-route command", func() {
var (
ui *testterm.FakeUI
routeRepo *testapi.FakeRouteRepository
domainRepo *testapi.FakeDomainRepository
requirementsFactory *testreq.FakeReqFactory
config core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo)
deps.RepoLocator = deps.RepoLocator.SetDomainRepository(domainRepo)
deps.Config = config
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("check-route").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
routeRepo = &testapi.FakeRouteRepository{}
开发者ID:Doebe,项目名称:workplace,代码行数:32,代码来源:check_route_test.go
示例12:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Push Command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
manifestRepo *testmanifest.FakeManifestRepository
starter *appCmdFakes.FakeApplicationStarter
stopper *appCmdFakes.FakeApplicationStopper
serviceBinder *serviceCmdFakes.FakeAppBinder
appRepo *testApplication.FakeApplicationRepository
domainRepo *testapi.FakeDomainRepository
routeRepo *testapi.FakeRouteRepository
stackRepo *testStacks.FakeStackRepository
serviceRepo *testapi.FakeServiceRepository
wordGenerator *testwords.FakeWordGenerator
requirementsFactory *testreq.FakeReqFactory
authRepo *testapi.FakeAuthenticationRepository
actor *fakeactors.FakePushActor
appfiles *fakeappfiles.FakeAppFiles
zipper *fakeappfiles.FakeZipper
OriginalCommandStart command_registry.Command
OriginalCommandStop command_registry.Command
OriginalCommandServiceBind command_registry.Command
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
开发者ID:juanpaulo,项目名称:cli,代码行数:31,代码来源:push_test.go
示例13:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("DeleteRoute", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
routeRepo *fakeapi.FakeRouteRepository
cmd command_registry.Command
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
domainRequirement *fakerequirements.FakeDomainRequirement
minAPIVersionRequirement requirements.Requirement
fakeDomain models.DomainFields
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = &fakeapi.FakeRouteRepository{}
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
开发者ID:digideskio,项目名称:cli,代码行数:31,代码来源:delete_route_test.go
示例14:
"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-route command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
routeRepo *testapi.FakeRouteRepository
deps command_registry.Dependency
configRepo core_config.Repository
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete-route").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{Inputs: []string{"yes"}}
routeRepo = &testapi.FakeRouteRepository{}
开发者ID:vframbach,项目名称:cli,代码行数:31,代码来源:delete_route_test.go
示例15:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("UnmapRoute", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
routeRepo *fakeapi.FakeRouteRepository
cmd command_registry.Command
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
applicationRequirement *fakerequirements.FakeApplicationRequirement
domainRequirement *fakerequirements.FakeDomainRequirement
minAPIVersionRequirement requirements.Requirement
fakeDomain models.DomainFields
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = &fakeapi.FakeRouteRepository{}
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
开发者ID:vframbach,项目名称:cli,代码行数:29,代码来源:unmap_route_test.go
示例16:
"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/cf/commands/route"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("create-route command", func() {
var (
ui *testterm.FakeUI
routeRepo *testapi.FakeRouteRepository
requirementsFactory *testreq.FakeReqFactory
config configuration.ReadWriter
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
routeRepo = &testapi.FakeRouteRepository{}
requirementsFactory = &testreq.FakeReqFactory{}
config = testconfig.NewRepositoryWithDefaults()
})
runCommand := func(args ...string) {
testcmd.RunCommand(NewCreateRoute(ui, config, routeRepo), args, requirementsFactory)
}
Describe("requirements", func() {
开发者ID:BlueSpice,项目名称:cli,代码行数:32,代码来源:create_route_test.go
示例17:
"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("unmap-route command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
routeRepo *testapi.FakeRouteRepository
requirementsFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("unmap-route").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = new(testterm.FakeUI)
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = new(testapi.FakeRouteRepository)
开发者ID:juanpaulo,项目名称:cli,代码行数:31,代码来源:unmap_route_test.go
示例18:
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/command_registry"
"github.com/cloudfoundry/cli/cf/configuration/core_config"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("map-route command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
routeRepo *testapi.FakeRouteRepository
requirementsFactory *testreq.FakeReqFactory
routeCreator *routeCmdFakes.FakeRouteCreator
OriginalCreateRoute command_registry.Command
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo)
deps.Config = configRepo
//save original create-route and restore later
OriginalCreateRoute = command_registry.Commands.FindCommand("create-route")
//inject fake 'CreateRoute' into registry
command_registry.Register(routeCreator)
开发者ID:juanpaulo,项目名称:cli,代码行数:30,代码来源:map_route_test.go
注:本文中的github.com/cloudfoundry/cli/cf/api/fakes.FakeRouteRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论