本文整理汇总了Golang中testhelpers/api.FakeRouteRepository类的典型用法代码示例。如果您正苦于以下问题:Golang FakeRouteRepository类的具体用法?Golang FakeRouteRepository怎么用?Golang FakeRouteRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeRouteRepository类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
testmanifest "testhelpers/manifest"
testreq "testhelpers/requirements"
testterm "testhelpers/terminal"
testwords "testhelpers/words"
"words"
)
var _ = Describe("Push Command", func() {
var (
cmd *Push
ui *testterm.FakeUI
configRepo configuration.ReadWriter
manifestRepo *testmanifest.FakeManifestRepository
starter *testcmd.FakeAppStarter
stopper *testcmd.FakeAppStopper
binder *testcmd.FakeAppBinder
appRepo *testapi.FakeApplicationRepository
domainRepo *testapi.FakeDomainRepository
routeRepo *testapi.FakeRouteRepository
stackRepo *testapi.FakeStackRepository
appBitsRepo *testapi.FakeApplicationBitsRepository
serviceRepo *testapi.FakeServiceRepo
wordGenerator words.WordGenerator
)
BeforeEach(func() {
manifestRepo = &testmanifest.FakeManifestRepository{}
starter = &testcmd.FakeAppStarter{}
stopper = &testcmd.FakeAppStopper{}
binder = &testcmd.FakeAppBinder{}
appRepo = &testapi.FakeApplicationRepository{}
示例2:
import (
. "cf/commands/route"
"cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
testapi "testhelpers/api"
testassert "testhelpers/assert"
testcmd "testhelpers/commands"
testconfig "testhelpers/configuration"
testreq "testhelpers/requirements"
testterm "testhelpers/terminal"
)
var _ = Describe("delete-route command", func() {
var routeRepo *testapi.FakeRouteRepository
var reqFactory *testreq.FakeReqFactory
BeforeEach(func() {
routeRepo = &testapi.FakeRouteRepository{}
reqFactory = &testreq.FakeReqFactory{}
})
It("fails requirements when not logged in", func() {
callDeleteRoute("y", []string{"-n", "my-host", "example.com"}, reqFactory, routeRepo)
Expect(testcmd.CommandDidPassRequirements).To(BeFalse())
})
Context("when logged in successfully", func() {
var ui *testterm.FakeUI
示例3:
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
testapi "testhelpers/api"
testassert "testhelpers/assert"
testcmd "testhelpers/commands"
testconfig "testhelpers/configuration"
testreq "testhelpers/requirements"
testterm "testhelpers/terminal"
)
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{}
示例4:
"cf/configuration"
"cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
testapi "testhelpers/api"
testassert "testhelpers/assert"
testcmd "testhelpers/commands"
testconfig "testhelpers/configuration"
testreq "testhelpers/requirements"
testterm "testhelpers/terminal"
)
var _ = Describe("routes command", func() {
var (
ui *testterm.FakeUI
routeRepo *testapi.FakeRouteRepository
configRepo configuration.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) {
cmd := NewListRoutes(ui, configRepo, routeRepo)