本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/configuration/coreconfig/coreconfigfakes.FakeRepository類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeRepository類的具體用法?Golang FakeRepository怎麽用?Golang FakeRepository使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeRepository類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
"github.com/cloudfoundry/cli/flags"
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("set-space-quota command", func() {
var (
ui *testterm.FakeUI
spaceRepo *spacesfakes.FakeSpaceRepository
quotaRepo *spacequotasfakes.FakeSpaceQuotaRepository
requirementsFactory *requirementsfakes.FakeFactory
configRepo *coreconfigfakes.FakeRepository
deps commandregistry.Dependency
cmd spacequota.SetSpaceQuota
flagContext flags.FlagContext
loginReq requirements.Requirement
orgReq *requirementsfakes.FakeTargetedOrgRequirement
)
BeforeEach(func() {
requirementsFactory = new(requirementsfakes.FakeFactory)
loginReq = requirements.Passing{Type: "login"}
requirementsFactory.NewLoginRequirementReturns(loginReq)
orgReq = new(requirementsfakes.FakeTargetedOrgRequirement)
requirementsFactory.NewTargetedOrgRequirementReturns(orgReq)
ui = new(testterm.FakeUI)
示例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{}
示例3:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
const TIMESTAMP_FORMAT = "2006-01-02T15:04:05.00-0700"
var _ = Describe("events command", func() {
var (
reqFactory *requirementsfakes.FakeFactory
eventsRepo *appeventsfakes.FakeAppEventsRepository
ui *testterm.FakeUI
config *coreconfigfakes.FakeRepository
deps commandregistry.Dependency
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedSpaceRequirement requirements.Requirement
applicationRequirement *requirementsfakes.FakeApplicationRequirement
cmd *application.Events
)
BeforeEach(func() {
cmd = &application.Events{}
ui = new(testterm.FakeUI)
eventsRepo = new(appeventsfakes.FakeAppEventsRepository)
config = new(coreconfigfakes.FakeRepository)
config.OrganizationFieldsReturns(models.OrganizationFields{Name: "my-org"})