本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/requirements/requirementsfakes.FakeRequirement类的典型用法代码示例。如果您正苦于以下问题:Golang FakeRequirement类的具体用法?Golang FakeRequirement怎么用?Golang FakeRequirement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeRequirement类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1:
"github.com/cloudfoundry/cli/cf/api"
"github.com/cloudfoundry/cli/cf/commands/space"
"github.com/cloudfoundry/cli/cf/models"
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
"github.com/cloudfoundry/cli/flags"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("space command", func() {
var (
ui *testterm.FakeUI
loginReq *requirementsfakes.FakeRequirement
targetedOrgReq *requirementsfakes.FakeTargetedOrgRequirement
reqFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
cmd space.ShowSpace
flagContext flags.FlagContext
getSpaceModel *plugin_models.GetSpace_Model
spaceRequirement *requirementsfakes.FakeSpaceRequirement
quotaRepo *spacequotasfakes.FakeSpaceQuotaRepository
)
BeforeEach(func() {
ui = new(testterm.FakeUI)
quotaRepo = new(spacequotasfakes.FakeSpaceQuotaRepository)
repoLocator := api.RepositoryLocator{}
repoLocator = repoLocator.SetSpaceQuotaRepository(quotaRepo)
getSpaceModel = new(plugin_models.GetSpace_Model)
deps = commandregistry.Dependency{
UI: ui,
开发者ID:Reejoshi,项目名称:cli,代码行数:32,代码来源:space_test.go
示例2:
"github.com/cloudfoundry/cli/cf/commands/spacequota"
"github.com/cloudfoundry/cli/cf/flags"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("create-space-quota", func() {
var (
ui *testterm.FakeUI
quotaRepo *spacequotasfakes.FakeSpaceQuotaRepository
requirementsFactory *requirementsfakes.FakeFactory
config *coreconfigfakes.FakeRepository
loginReq *requirementsfakes.FakeRequirement
targetedOrgReq *requirementsfakes.FakeTargetedOrgRequirement
minApiVersionReq *requirementsfakes.FakeRequirement
reqFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
cmd spacequota.CreateSpaceQuota
flagContext flags.FlagContext
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
quotaRepo = new(spacequotasfakes.FakeSpaceQuotaRepository)
requirementsFactory = new(requirementsfakes.FakeFactory)
config = new(coreconfigfakes.FakeRepository)
repoLocator := api.RepositoryLocator{}
开发者ID:jasonkeene,项目名称:cli,代码行数:31,代码来源:create_space_quota_test.go
示例3:
package requirements_test
import (
. "github.com/cloudfoundry/cli/cf/requirements"
"errors"
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Requirements", func() {
Context("When there are multiple requirements", func() {
It("executes all the requirements", func() {
r1 := new(requirementsfakes.FakeRequirement)
r1.ExecuteReturns(nil)
r2 := new(requirementsfakes.FakeRequirement)
r2.ExecuteReturns(nil)
// SETUP
requirements := Requirements{
r1,
r2,
}
// EXECUTE
err := requirements.Execute()
// ASSERT
Expect(err).NotTo(HaveOccurred())
Expect(r1.ExecuteCallCount()).To(Equal(1))
开发者ID:Reejoshi,项目名称:cli,代码行数:31,代码来源:requirements_test.go
注:本文中的github.com/cloudfoundry/cli/cf/requirements/requirementsfakes.FakeRequirement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论