本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/apifakes.FakeDomainRepository类的典型用法代码示例。如果您正苦于以下问题:Golang FakeDomainRepository类的具体用法?Golang FakeDomainRepository怎么用?Golang FakeDomainRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeDomainRepository类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Execute
}
func (r passingRequirement) Execute() error {
return nil
}
var _ = Describe("CreateSharedDomain", func() {
var (
ui *testterm.FakeUI
routingAPIRepo *apifakes.FakeRoutingAPIRepository
domainRepo *apifakes.FakeDomainRepository
configRepo coreconfig.Repository
cmd domain.CreateSharedDomain
deps commandregistry.Dependency
factory *requirementsfakes.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 = new(apifakes.FakeRoutingAPIRepository)
repoLocator := deps.RepoLocator.SetRoutingAPIRepository(routingAPIRepo)
开发者ID:yingkitw,项目名称:cli,代码行数:30,代码来源:create_shared_domain_test.go
示例2:
"github.com/cloudfoundry/cli/cf/terminal"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/commands/route"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("routes command", func() {
var (
ui *testterm.FakeUI
routeRepo *apifakes.FakeRouteRepository
domainRepo *apifakes.FakeDomainRepository
configRepo coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo).SetDomainRepository(domainRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("routes").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
开发者ID:jasonkeene,项目名称:cli,代码行数:32,代码来源:routes_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/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("delete-domain command", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
domainRepo *apifakes.FakeDomainRepository
requirementsFactory *testreq.FakeReqFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetDomainRepository(domainRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("delete-domain").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{
Inputs: []string{"yes"},
}
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:delete_domain_test.go
示例4:
"github.com/cloudfoundry/cli/cf/requirements"
"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/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("delete-shared-domain command", func() {
var (
ui *testterm.FakeUI
domainRepo *apifakes.FakeDomainRepository
requirementsFactory *requirementsfakes.FakeFactory
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetDomainRepository(domainRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("delete-shared-domain").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
domainRepo = new(apifakes.FakeDomainRepository)
requirementsFactory = new(requirementsfakes.FakeFactory)
开发者ID:Reejoshi,项目名称:cli,代码行数:31,代码来源:delete_shared_domain_test.go
示例5:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("DomainRequirement", func() {
var config coreconfig.ReadWriter
BeforeEach(func() {
config = testconfig.NewRepository()
config.SetOrganizationFields(models.OrganizationFields{GUID: "the-org-guid"})
})
It("succeeds when the domain is found", func() {
domain := models.DomainFields{Name: "example.com", GUID: "domain-guid"}
domainRepo := new(apifakes.FakeDomainRepository)
domainRepo.FindByNameInOrgReturns(domain, nil)
domainReq := NewDomainRequirement("example.com", config, domainRepo)
err := domainReq.Execute()
Expect(err).NotTo(HaveOccurred())
orgName, orgGUID := domainRepo.FindByNameInOrgArgsForCall(0)
Expect(orgName).To(Equal("example.com"))
Expect(orgGUID).To(Equal("the-org-guid"))
Expect(domainReq.GetDomain()).To(Equal(domain))
})
It("fails when the domain is not found", func() {
domainRepo := new(apifakes.FakeDomainRepository)
domainRepo.FindByNameInOrgReturns(models.DomainFields{}, errors.NewModelNotFoundError("Domain", ""))
domainReq := NewDomainRequirement("example.com", config, domainRepo)
开发者ID:Reejoshi,项目名称:cli,代码行数:31,代码来源:domain_test.go
示例6:
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 *apifakes.FakeDomainRepository
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetDomainRepository(domainRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("create-domain").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
domainRepo = new(apifakes.FakeDomainRepository)
configRepo = testconfig.NewRepositoryWithAccessToken(coreconfig.TokenInfo{Username: "my-user"})
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:create_domain_test.go
示例7:
"github.com/cloudfoundry/cli/cf/commands/domain"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("ListDomains", func() {
var (
ui *testterm.FakeUI
routingAPIRepo *apifakes.FakeRoutingAPIRepository
domainRepo *apifakes.FakeDomainRepository
configRepo coreconfig.Repository
cmd domain.ListDomains
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedOrgRequirement *requirementsfakes.FakeTargetedOrgRequirement
domainFields []models.DomainFields
routerGroups models.RouterGroups
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routingAPIRepo = new(apifakes.FakeRoutingAPIRepository)
repoLocator := deps.RepoLocator.SetRoutingAPIRepository(routingAPIRepo)
开发者ID:Reejoshi,项目名称:cli,代码行数:29,代码来源:domains_test.go
示例8:
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 coreconfig.Repository
routeRepo *apifakes.FakeRouteRepository
domainRepo *apifakes.FakeDomainRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedOrgRequirement *requirementsfakes.FakeTargetedOrgRequirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = new(apifakes.FakeRouteRepository)
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
开发者ID:jasonkeene,项目名称:cli,代码行数:30,代码来源:check_route_test.go
示例9:
"github.com/cloudfoundry/cli/cf/api/apifakes"
cferrors "github.com/cloudfoundry/cli/cf/errors"
"github.com/cloudfoundry/cli/cf/errors/errorsfakes"
"github.com/cloudfoundry/cli/cf/models"
"github.com/cloudfoundry/cli/cf/terminal/terminalfakes"
"github.com/cloudfoundry/cli/utils/words/generator/generatorfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Routes", func() {
var (
fakeUI *terminalfakes.FakeUI
fakeRouteRepository *apifakes.FakeRouteRepository
fakeDomainRepository *apifakes.FakeDomainRepository
routeActor RouteActor
expectedRoute models.Route
expectedDomain models.DomainFields
wordGenerator *generatorfakes.FakeWordGenerator
)
BeforeEach(func() {
fakeUI = &terminalfakes.FakeUI{}
fakeRouteRepository = new(apifakes.FakeRouteRepository)
fakeDomainRepository = new(apifakes.FakeDomainRepository)
routeActor = NewRouteActor(fakeUI, fakeRouteRepository, fakeDomainRepository)
wordGenerator = new(generatorfakes.FakeWordGenerator)
})
Describe("CreateRandomTCPRoute", func() {
BeforeEach(func() {
开发者ID:jasonkeene,项目名称:cli,代码行数:32,代码来源:routes_test.go
注:本文中的github.com/cloudfoundry/cli/cf/api/apifakes.FakeDomainRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论