本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/api/apifakes.FakeUserRepository.CreateArgsForCall方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeUserRepository.CreateArgsForCall方法的具體用法?Golang FakeUserRepository.CreateArgsForCall怎麽用?Golang FakeUserRepository.CreateArgsForCall使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/cli/cf/api/apifakes.FakeUserRepository
的用法示例。
在下文中一共展示了FakeUserRepository.CreateArgsForCall方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
}
runCommand := func(args ...string) bool {
return testcmd.RunCLICommand("create-user", args, requirementsFactory, updateCommandDependency, false, ui)
}
It("creates a user", func() {
runCommand("my-user", "my-password")
Expect(ui.Outputs()).To(ContainSubstrings(
[]string{"Creating user", "my-user"},
[]string{"OK"},
[]string{"TIP"},
))
userName, password := userRepo.CreateArgsForCall(0)
Expect(userName).To(Equal("my-user"))
Expect(password).To(Equal("my-password"))
})
Context("when creating the user returns an error", func() {
It("prints a warning when the given user already exists", func() {
userRepo.CreateReturns(errors.NewModelAlreadyExistsError("User", "my-user"))
runCommand("my-user", "my-password")
Expect(ui.WarnOutputs).To(ContainSubstrings(
[]string{"already exists"},
))
Expect(ui.Outputs()).ToNot(ContainSubstrings([]string{"FAILED"}))