本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/applications/applicationsfakes.FakeApplicationRepository类的典型用法代码示例。如果您正苦于以下问题:Golang FakeApplicationRepository类的具体用法?Golang FakeApplicationRepository怎么用?Golang FakeApplicationRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeApplicationRepository类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1:
"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/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("enable-ssh command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
appRepo *applicationsfakes.FakeApplicationRepository
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{}
appRepo = new(applicationsfakes.FakeApplicationRepository)
})
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:enable_ssh_test.go
示例2:
"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/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("set-env command", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
app models.Application
appRepo *applicationsfakes.FakeApplicationRepository
requirementsFactory *testreq.FakeReqFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("set-env").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
app = models.Application{}
app.Name = "my-app"
开发者ID:yingkitw,项目名称:cli,代码行数:32,代码来源:set_env_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/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("env command", func() {
var (
ui *testterm.FakeUI
app models.Application
appRepo *applicationsfakes.FakeApplicationRepository
configRepo coreconfig.Repository
requirementsFactory *testreq.FakeReqFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("env").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
app = models.Application{}
开发者ID:yingkitw,项目名称:cli,代码行数:32,代码来源:env_test.go
示例4:
import (
"errors"
"github.com/cloudfoundry/cli/cf/models"
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/cloudfoundry/cli/cf/api/applications/applicationsfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("DiegoApplication", func() {
var (
req requirements.DiegoApplicationRequirement
appRepo *applicationsfakes.FakeApplicationRepository
appName string
)
BeforeEach(func() {
appName = "fake-app-name"
appRepo = new(applicationsfakes.FakeApplicationRepository)
req = requirements.NewDiegoApplicationRequirement(appName, appRepo)
})
Describe("GetApplication", func() {
It("returns an empty application", func() {
Expect(req.GetApplication()).To(Equal(models.Application{}))
})
Context("when the requirement has been executed", func() {
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:diego_application_test.go
示例5:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
"github.com/cloudfoundry/cli/testhelpers/maker"
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("scale command", func() {
var (
requirementsFactory *testreq.FakeReqFactory
restarter *applicationfakes.FakeApplicationRestarter
appRepo *applicationsfakes.FakeApplicationRepository
ui *testterm.FakeUI
config coreconfig.Repository
app models.Application
OriginalCommand commandregistry.Command
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.Config = config
//inject fake 'command dependency' into registry
commandregistry.Register(restarter)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("scale").SetDependency(deps, pluginCall))
}
开发者ID:yingkitw,项目名称:cli,代码行数:32,代码来源:scale_test.go
示例6:
package requirements_test
import (
"github.com/cloudfoundry/cli/cf/api/applications/applicationsfakes"
"github.com/cloudfoundry/cli/cf/errors"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/cloudfoundry/cli/cf/requirements"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("ApplicationRequirement", func() {
var appRepo *applicationsfakes.FakeApplicationRepository
BeforeEach(func() {
appRepo = new(applicationsfakes.FakeApplicationRepository)
})
It("succeeds when an app with the given name exists", func() {
app := models.Application{}
app.Name = "my-app"
app.GUID = "my-app-guid"
appRepo.ReadReturns(app, nil)
appReq := NewApplicationRequirement("foo", appRepo)
err := appReq.Execute()
Expect(err).NotTo(HaveOccurred())
Expect(appRepo.ReadArgsForCall(0)).To(Equal("foo"))
Expect(appReq.GetApplication()).To(Equal(app))
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:application_test.go
示例7:
"sync"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("start command", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
defaultAppForStart models.Application
defaultInstanceResponses [][]models.AppInstanceFields
defaultInstanceErrorCodes []string
requirementsFactory *testreq.FakeReqFactory
logMessages []logs.Loggable
logRepo *logsfakes.FakeLogsRepository
appInstancesRepo *appinstancesfakes.FakeAppInstancesRepository
appRepo *applicationsfakes.FakeApplicationRepository
originalAppCommand commandregistry.Command
deps commandregistry.Dependency
displayApp *applicationfakes.FakeAppDisplayer
)
updateCommandDependency := func(logsRepo logs.LogsRepository) {
deps.UI = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetLogsRepository(logsRepo)
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.RepoLocator = deps.RepoLocator.SetAppInstancesRepository(appInstancesRepo)
开发者ID:yingkitw,项目名称:cli,代码行数:30,代码来源:start_test.go
示例8:
"github.com/cloudfoundry/cli/cf/errors"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CopySource", func() {
var (
ui *testterm.FakeUI
config coreconfig.Repository
requirementsFactory *testreq.FakeReqFactory
authRepo *authenticationfakes.FakeAuthenticationRepository
appRepo *applicationsfakes.FakeApplicationRepository
copyAppSourceRepo *copyapplicationsourcefakes.FakeCopyApplicationSourceRepository
spaceRepo *apifakes.FakeSpaceRepository
orgRepo *organizationsfakes.FakeOrganizationRepository
appRestarter *applicationfakes.FakeApplicationRestarter
OriginalCommand commandregistry.Command
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetAuthenticationRepository(authRepo)
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.RepoLocator = deps.RepoLocator.SetCopyApplicationSourceRepository(copyAppSourceRepo)
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
deps.Config = config
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:copy_source_test.go
示例9:
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 coreconfig.Repository
appRepo *applicationsfakes.FakeApplicationRepository
routeRepo *apifakes.FakeRouteRepository
requirementsFactory *testreq.FakeReqFactory
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{}
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:delete_test.go
示例10:
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/commandregistry"
"github.com/cloudfoundry/cli/cf/commands/application"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("stop command", func() {
var (
ui *testterm.FakeUI
app models.Application
appRepo *applicationsfakes.FakeApplicationRepository
requirementsFactory *testreq.FakeReqFactory
config coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.Config = config
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("stop").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
appRepo = new(applicationsfakes.FakeApplicationRepository)
开发者ID:yingkitw,项目名称:cli,代码行数:32,代码来源:stop_test.go
示例11:
"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/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Rename command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
configRepo coreconfig.Repository
appRepo *applicationsfakes.FakeApplicationRepository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("rename").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{}
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:rename_test.go
注:本文中的github.com/cloudfoundry/cli/cf/api/applications/applicationsfakes.FakeApplicationRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论