本文整理汇总了Golang中testhelpers/api.FakeRouteRepository.Routes方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeRouteRepository.Routes方法的具体用法?Golang FakeRouteRepository.Routes怎么用?Golang FakeRouteRepository.Routes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testhelpers/api.FakeRouteRepository
的用法示例。
在下文中一共展示了FakeRouteRepository.Routes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
domain := models.DomainFields{Name: "example.com"}
domain2 := models.DomainFields{Name: "cookieclicker.co"}
app1 := models.ApplicationFields{Name: "dora"}
app2 := models.ApplicationFields{Name: "bora"}
route := models.Route{}
route.Host = "hostname-1"
route.Domain = domain
route.Apps = []models.ApplicationFields{app1}
route2 := models.Route{}
route2.Host = "hostname-2"
route2.Domain = domain2
route2.Apps = []models.ApplicationFields{app1, app2}
routeRepo.Routes = []models.Route{route, route2}
})
It("lists routes", func() {
runCommand()
testassert.SliceContains(ui.Outputs, testassert.Lines{
{"Getting routes", "my-user"},
{"host", "domain", "apps"},
{"hostname-1", "example.com", "dora"},
{"hostname-2", "cookieclicker.co", "dora", "bora"},
})
})
})
Context("when there are not routes", func() {