本文整理汇总了Golang中testhelpers/api.FakeOrgRepository.FindByNameNotFound方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeOrgRepository.FindByNameNotFound方法的具体用法?Golang FakeOrgRepository.FindByNameNotFound怎么用?Golang FakeOrgRepository.FindByNameNotFound使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testhelpers/api.FakeOrgRepository
的用法示例。
在下文中一共展示了FakeOrgRepository.FindByNameNotFound方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
{"Assigning", "my-user", "my-space", models.SpaceRoleToUserInput[models.SPACE_MANAGER]},
{"Assigning", "my-user", "my-space", models.SpaceRoleToUserInput[models.SPACE_DEVELOPER]},
{"TIP"},
})
Expect(defaultSpaceRepo.CreateSpaceName).To(Equal("my-space"))
Expect(defaultSpaceRepo.CreateSpaceOrgGuid).To(Equal(org.Guid))
Expect(defaultUserRepo.SetSpaceRoleUserGuid).To(Equal("my-user-guid"))
Expect(defaultUserRepo.SetSpaceRoleSpaceGuid).To(Equal("my-space-guid"))
Expect(defaultUserRepo.SetSpaceRoleRole).To(Equal(models.SPACE_DEVELOPER))
})
It("TestCreateSpaceInOrgWhenTheOrgDoesNotExist", func() {
resetSpaceDefaults()
defaultOrgRepo.FindByNameNotFound = true
ui := callCreateSpace([]string{"-o", "cool-organization", "my-space"}, defaultReqFactory, defaultSpaceRepo, defaultOrgRepo, defaultUserRepo)
testassert.SliceContains(ui.Outputs, testassert.Lines{
{"FAILED"},
{"cool-organization", "does not exist"},
})
Expect(defaultSpaceRepo.CreateSpaceName).To(Equal(""))
})
It("TestCreateSpaceInOrgWhenErrorFindingOrg", func() {
resetSpaceDefaults()
defaultOrgRepo.FindByNameErr = true
示例2:
Expect(ui.ShowConfigurationCalled).To(BeTrue())
Expect(config.OrganizationFields().Guid).To(Equal("my-organization-guid"))
})
It("TestTargetOrganizationWhenUserDoesNotHaveAccess", func() {
orgs := []models.Organization{}
orgRepo.Organizations = orgs
orgRepo.FindByNameErr = true
ui := callTarget([]string{"-o", "my-organization"}, reqFactory, config, orgRepo, spaceRepo)
testassert.SliceContains(ui.Outputs, testassert.Lines{{"FAILED"}})
})
It("TestTargetOrganizationWhenOrgNotFound", func() {
orgRepo.FindByNameNotFound = true
ui := callTarget([]string{"-o", "my-organization"}, reqFactory, config, orgRepo, spaceRepo)
testassert.SliceContains(ui.Outputs, testassert.Lines{
{"FAILED"},
{"my-organization", "not found"},
})
})
It("TestTargetSpaceWhenNoOrganizationIsSelected", func() {
config.SetOrganizationFields(models.OrganizationFields{})
ui := callTarget([]string{"-s", "my-space"}, reqFactory, config, orgRepo, spaceRepo)
testassert.SliceContains(ui.Outputs, testassert.Lines{