本文整理匯總了Golang中code/cloudfoundry/org/cli/cf/api/apifakes.FakeUserRepository.SetSpaceRoleByGUIDCallCount方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeUserRepository.SetSpaceRoleByGUIDCallCount方法的具體用法?Golang FakeUserRepository.SetSpaceRoleByGUIDCallCount怎麽用?Golang FakeUserRepository.SetSpaceRoleByGUIDCallCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類code/cloudfoundry/org/cli/cf/api/apifakes.FakeUserRepository
的用法示例。
在下文中一共展示了FakeUserRepository.SetSpaceRoleByGUIDCallCount方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
spaceRepo.CreateReturns(models.Space{}, errors.NewHTTPError(400, errors.SpaceNameTaken, "Space already exists"))
runCommand("my-space")
Expect(ui.Outputs()).To(ContainSubstrings(
[]string{"Creating space", "my-space"},
[]string{"OK"},
))
Expect(ui.WarnOutputs).To(ContainSubstrings([]string{"my-space", "already exists"}))
Expect(ui.Outputs()).ToNot(ContainSubstrings(
[]string{"Assigning", "my-user", "my-space", "SpaceManager"},
))
Expect(spaceRepo.CreateCallCount()).To(Equal(1))
actualSpaceName, _, _ := spaceRepo.CreateArgsForCall(0)
Expect(actualSpaceName).To(Equal("my-space"))
Expect(userRepo.SetSpaceRoleByGUIDCallCount()).To(BeZero())
})
Context("when the -o flag is provided", func() {
It("creates a space within that org", func() {
org := models.Organization{
OrganizationFields: models.OrganizationFields{
Name: "other-org",
GUID: "org-guid-1",
}}
orgRepo.FindByNameReturns(org, nil)
runCommand("-o", "other-org", "my-space")
Expect(ui.Outputs()).To(ContainSubstrings(
[]string{"Creating space", "my-space", "other-org", "my-user"},