本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/api/appinstances/appinstancesfakes.FakeAppInstancesRepository類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeAppInstancesRepository類的具體用法?Golang FakeAppInstancesRepository怎麽用?Golang FakeAppInstancesRepository使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeAppInstancesRepository類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
"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)
示例2:
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/commandregistry"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("restart-app-instance", func() {
var (
ui *testterm.FakeUI
config coreconfig.Repository
appInstancesRepo *appinstancesfakes.FakeAppInstancesRepository
requirementsFactory *requirementsfakes.FakeFactory
application models.Application
deps commandregistry.Dependency
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
appInstancesRepo = new(appinstancesfakes.FakeAppInstancesRepository)
config = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
requirementsFactory.NewLoginRequirementReturns(requirements.Passing{})
requirementsFactory.NewTargetedSpaceRequirementReturns(requirements.Passing{})
application = models.Application{}
application.Name = "my-app"
示例3:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("App", func() {
var (
ui *testterm.FakeUI
appSummaryRepo *apifakes.FakeAppSummaryRepository
appInstancesRepo *appinstancesfakes.FakeAppInstancesRepository
getAppModel *plugin_models.GetAppModel
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedSpaceRequirement requirements.Requirement
applicationRequirement *requirementsfakes.FakeApplicationRequirement
)
BeforeEach(func() {
cmd = &application.ShowApp{}
flagContext = flags.NewFlagContext(cmd.MetaData().Flags)
ui = &testterm.FakeUI{}
getAppModel = &plugin_models.GetAppModel{}