本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/api/organizations/organizationsfakes.FakeOrganizationRepository.FindByNameCallCount方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeOrganizationRepository.FindByNameCallCount方法的具體用法?Golang FakeOrganizationRepository.FindByNameCallCount怎麽用?Golang FakeOrganizationRepository.FindByNameCallCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/cli/cf/api/organizations/organizationsfakes.FakeOrganizationRepository
的用法示例。
在下文中一共展示了FakeOrganizationRepository.FindByNameCallCount方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
Context("there are no errors", func() {
BeforeEach(func() {
org := models.Organization{}
org.Name = "my-organization"
org.GUID = "my-organization-guid"
orgRepo.ListOrgsReturns([]models.Organization{org}, nil)
orgRepo.FindByNameReturns(org, nil)
config.SetOrganizationFields(models.OrganizationFields{Name: org.Name, GUID: org.GUID})
})
It("it updates the organization in the config", func() {
callTarget([]string{"-o", "my-organization"})
Expect(orgRepo.FindByNameCallCount()).To(Equal(1))
Expect(orgRepo.FindByNameArgsForCall(0)).To(Equal("my-organization"))
Expect(ui.ShowConfigurationCalled).To(BeTrue())
Expect(config.OrganizationFields().GUID).To(Equal("my-organization-guid"))
})
It("updates the space in the config", func() {
space := models.Space{}
space.Name = "my-space"
space.GUID = "my-space-guid"
spaceRepo.FindByNameReturns(space, nil)
callTarget([]string{"-s", "my-space"})