本文整理匯總了Golang中github.com/cloudfoundry-incubator/bbs/fake_bbs.FakeClient.TasksByDomainArgsForCall方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeClient.TasksByDomainArgsForCall方法的具體用法?Golang FakeClient.TasksByDomainArgsForCall怎麽用?Golang FakeClient.TasksByDomainArgsForCall使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry-incubator/bbs/fake_bbs.FakeClient
的用法示例。
在下文中一共展示了FakeClient.TasksByDomainArgsForCall方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
})
Context("when a domain query param is provided", func() {
It("gets all tasks", func() {
request, err := http.NewRequest("", "http://example.com?domain=domain-1", nil)
Expect(err).NotTo(HaveOccurred())
handler.GetAll(responseRecorder, request)
Expect(responseRecorder.Code).To(Equal(http.StatusOK))
var tasks []receptor.TaskResponse
err = json.Unmarshal(responseRecorder.Body.Bytes(), &tasks)
Expect(err).NotTo(HaveOccurred())
Expect(fakeClient.TasksByDomainCallCount()).To(Equal(1))
actualDomain := fakeClient.TasksByDomainArgsForCall(0)
Expect(actualDomain).To(Equal("domain-1"))
expectedTasks := []receptor.TaskResponse{
serialization.TaskToResponse(domain1Task),
}
Expect(tasks).To(ConsistOf(expectedTasks))
})
})
Context("when a domain query param is not provided", func() {
It("gets all tasks", func() {
handler.GetAll(responseRecorder, newTestRequest(""))
Expect(responseRecorder.Code).To(Equal(http.StatusOK))
var tasks []receptor.TaskResponse