Documentation ¶
Index ¶
- func Handler(rendC *render.Render) func(http.Handler) http.Handler
- type RenderClient
- type RenderClientMock
- func (mock *RenderClientMock) BuildHTML(w io.Writer, status int, templateName string, pageModel interface{}) error
- func (mock *RenderClientMock) BuildHTMLCalls() []struct{ ... }
- func (mock *RenderClientMock) SetError(w io.Writer, status int, errorModel model.ErrorResponse) error
- func (mock *RenderClientMock) SetErrorCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RenderClient ¶
type RenderClientMock ¶
type RenderClientMock struct { // BuildHTMLFunc mocks the BuildHTML method. BuildHTMLFunc func(w io.Writer, status int, templateName string, pageModel interface{}) error // SetErrorFunc mocks the SetError method. SetErrorFunc func(w io.Writer, status int, errorModel model.ErrorResponse) error // contains filtered or unexported fields }
RenderClientMock is a mock implementation of RenderClient.
func TestSomethingThatUsesRenderClient(t *testing.T) { // make and configure a mocked RenderClient mockedRenderClient := &RenderClientMock{ BuildHTMLFunc: func(w io.Writer, status int, templateName string, pageModel interface{}) error { panic("mock out the BuildHTML method") }, SetErrorFunc: func(w io.Writer, status int, errorModel model.ErrorResponse) error { panic("mock out the SetError method") }, } // use mockedRenderClient in code that requires RenderClient // and then make assertions. }
func (*RenderClientMock) BuildHTML ¶
func (mock *RenderClientMock) BuildHTML(w io.Writer, status int, templateName string, pageModel interface{}) error
BuildHTML calls BuildHTMLFunc.
func (*RenderClientMock) BuildHTMLCalls ¶
func (mock *RenderClientMock) BuildHTMLCalls() []struct { W io.Writer Status int TemplateName string PageModel interface{} }
BuildHTMLCalls gets all the calls that were made to BuildHTML. Check the length with:
len(mockedRenderClient.BuildHTMLCalls())
func (*RenderClientMock) SetError ¶
func (mock *RenderClientMock) SetError(w io.Writer, status int, errorModel model.ErrorResponse) error
SetError calls SetErrorFunc.
func (*RenderClientMock) SetErrorCalls ¶
func (mock *RenderClientMock) SetErrorCalls() []struct { W io.Writer Status int ErrorModel model.ErrorResponse }
SetErrorCalls gets all the calls that were made to SetError. Check the length with:
len(mockedRenderClient.SetErrorCalls())
Click to show internal directories.
Click to hide internal directories.