当前位置: 首页>>代码示例>>Golang>>正文


Golang api.FakeRouteRepository类代码示例

本文整理汇总了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{}
开发者ID:juggernaut,项目名称:cli,代码行数:31,代码来源:push_test.go

示例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
开发者ID:knolleary,项目名称:cli,代码行数:29,代码来源:delete_route_test.go

示例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{}
开发者ID:nota-ja,项目名称:cli,代码行数:30,代码来源:delete_test.go

示例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)
开发者ID:nota-ja,项目名称:cli,代码行数:32,代码来源:routes_test.go


注:本文中的testhelpers/api.FakeRouteRepository类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。