本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/api/fakes.FakeDomainRepository類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeDomainRepository類的具體用法?Golang FakeDomainRepository怎麽用?Golang FakeDomainRepository使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeDomainRepository類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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/cf/commands/domain"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("domains command", func() {
var (
ui *testterm.FakeUI
configRepo configuration.ReadWriter
domainRepo *testapi.FakeDomainRepository
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
domainRepo = &testapi.FakeDomainRepository{}
requirementsFactory = &testreq.FakeReqFactory{}
})
runCommand := func(args ...string) {
testcmd.RunCommand(NewListDomains(ui, configRepo, domainRepo), args, requirementsFactory)
}
Describe("requirements", func() {
示例2:
"github.com/cloudfoundry/cli/cf/commands/domain"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("ListDomains", func() {
var (
ui *testterm.FakeUI
routingApiRepo *fakeapi.FakeRoutingApiRepository
domainRepo *fakeapi.FakeDomainRepository
configRepo core_config.Repository
cmd domain.ListDomains
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedOrgRequirement *fakerequirements.FakeTargetedOrgRequirement
domainFields []models.DomainFields
routerGroups models.RouterGroups
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routingApiRepo = &fakeapi.FakeRoutingApiRepository{}
repoLocator := deps.RepoLocator.SetRoutingApiRepository(routingApiRepo)
示例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/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("delete-domain command", func() {
var (
cmd *DeleteDomain
ui *testterm.FakeUI
configRepo configuration.ReadWriter
domainRepo *testapi.FakeDomainRepository
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{
Inputs: []string{"yes"},
}
domainRepo = &testapi.FakeDomainRepository{}
requirementsFactory = &testreq.FakeReqFactory{
LoginSuccess: true,
TargetedOrgSuccess: true,
}
configRepo = testconfig.NewRepositoryWithDefaults()
示例4:
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/cf/command_registry"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("domains command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
domainRepo *testapi.FakeDomainRepository
requirementsFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetDomainRepository(domainRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("domains").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
domainRepo = &testapi.FakeDomainRepository{}
示例5:
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Push Command", func() {
var (
cmd *Push
ui *testterm.FakeUI
configRepo configuration.ReadWriter
manifestRepo *testmanifest.FakeManifestRepository
starter *testcmd.FakeAppStarter
stopper *testcmd.FakeAppStopper
serviceBinder *testcmd.FakeAppBinder
appRepo *testapi.FakeApplicationRepository
domainRepo *testapi.FakeDomainRepository
routeRepo *testapi.FakeRouteRepository
stackRepo *testapi.FakeStackRepository
serviceRepo *testapi.FakeServiceRepo
wordGenerator words.WordGenerator
requirementsFactory *testreq.FakeReqFactory
authRepo *testapi.FakeAuthenticationRepository
actor *fakeactors.FakePushActor
app_files *fakeappfiles.FakeAppFiles
zipper *fakeappfiles.FakeZipper
)
BeforeEach(func() {
manifestRepo = &testmanifest.FakeManifestRepository{}
starter = &testcmd.FakeAppStarter{}
stopper = &testcmd.FakeAppStopper{}
serviceBinder = &testcmd.FakeAppBinder{}
示例6:
"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("delete-shared-domain command", func() {
var (
ui *testterm.FakeUI
domainRepo *testapi.FakeDomainRepository
requirementsFactory *testreq.FakeReqFactory
configRepo core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetDomainRepository(domainRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete-shared-domain").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
domainRepo = &testapi.FakeDomainRepository{}
requirementsFactory = &testreq.FakeReqFactory{}
示例7:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CheckRoute", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
routeRepo *fakeapi.FakeRouteRepository
domainRepo *fakeapi.FakeDomainRepository
cmd command_registry.Command
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedOrgRequirement *fakerequirements.FakeTargetedOrgRequirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = &fakeapi.FakeRouteRepository{}
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
示例8:
"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/cf/commands/domain"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("delete-shared-domain command", func() {
var (
ui *testterm.FakeUI
domainRepo *testapi.FakeDomainRepository
requirementsFactory *testreq.FakeReqFactory
configRepo core_config.ReadWriter
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
domainRepo = &testapi.FakeDomainRepository{}
requirementsFactory = &testreq.FakeReqFactory{}
configRepo = testconfig.NewRepositoryWithDefaults()
})
runCommand := func(args ...string) bool {
return testcmd.RunCommand(NewDeleteSharedDomain(ui, configRepo, domainRepo), args, requirementsFactory)
}
Describe("requirements", func() {
示例9:
"github.com/cloudfoundry/cli/cf/configuration/core_config"
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("check-route command", func() {
var (
ui *testterm.FakeUI
routeRepo *testapi.FakeRouteRepository
domainRepo *testapi.FakeDomainRepository
requirementsFactory *testreq.FakeReqFactory
config core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo)
deps.RepoLocator = deps.RepoLocator.SetDomainRepository(domainRepo)
deps.Config = config
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("check-route").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
routeRepo = &testapi.FakeRouteRepository{}
示例10:
"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/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("delete-domain command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
domainRepo *testapi.FakeDomainRepository
requirementsFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetDomainRepository(domainRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete-domain").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{
Inputs: []string{"yes"},
}
示例11: Execute
}
func (r passingRequirement) Execute() bool {
return true
}
var _ = Describe("CreateSharedDomain", func() {
var (
ui *testterm.FakeUI
routingApiRepo *fakeapi.FakeRoutingApiRepository
domainRepo *fakeapi.FakeDomainRepository
configRepo core_config.Repository
cmd domain.CreateSharedDomain
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
routingApiRequirement requirements.Requirement
minAPIVersionRequirement requirements.Requirement
routerGroups models.RouterGroups
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routingApiRepo = &fakeapi.FakeRoutingApiRepository{}
repoLocator := deps.RepoLocator.SetRoutingApiRepository(routingApiRepo)
示例12:
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("create domain command", func() {
var (
requirementsFactory *testreq.FakeReqFactory
ui *testterm.FakeUI
domainRepo *testapi.FakeDomainRepository
configRepo core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetDomainRepository(domainRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("create-domain").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
domainRepo = &testapi.FakeDomainRepository{}
configRepo = testconfig.NewRepositoryWithAccessToken(core_config.TokenInfo{Username: "my-user"})
示例13:
"github.com/cloudfoundry/cli/cf/configuration/core_config"
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("Testing with ginkgo", func() {
var (
requirementsFactory *testreq.FakeReqFactory
ui *testterm.FakeUI
domainRepo *testapi.FakeDomainRepository
configRepo core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetDomainRepository(domainRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("create-shared-domain").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
domainRepo = &testapi.FakeDomainRepository{}
configRepo = testconfig.NewRepositoryWithAccessToken(core_config.TokenInfo{Username: "my-user"})