interfacestest

package
v1.23.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RendererMock

type RendererMock struct {
	// BuildPageFunc mocks the BuildPage method.
	BuildPageFunc func(w io.Writer, pageModel interface{}, templateName string)

	// NewBasePageModelFunc mocks the NewBasePageModel method.
	NewBasePageModelFunc func() model.Page
	// contains filtered or unexported fields
}

RendererMock is a mock implementation of interfaces.Renderer.

    func TestSomethingThatUsesRenderer(t *testing.T) {

        // make and configure a mocked interfaces.Renderer
        mockedRenderer := &RendererMock{
            BuildPageFunc: func(w io.Writer, pageModel interface{}, templateName string)  {
	               panic("mock out the BuildPage method")
            },
            NewBasePageModelFunc: func() model.Page {
	               panic("mock out the NewBasePageModel method")
            },
        }

        // use mockedRenderer in code that requires interfaces.Renderer
        // and then make assertions.

    }

func (*RendererMock) BuildPage added in v0.5.0

func (mock *RendererMock) BuildPage(w io.Writer, pageModel interface{}, templateName string)

BuildPage calls BuildPageFunc.

func (*RendererMock) BuildPageCalls added in v0.5.0

func (mock *RendererMock) BuildPageCalls() []struct {
	W            io.Writer
	PageModel    interface{}
	TemplateName string
}

BuildPageCalls gets all the calls that were made to BuildPage. Check the length with:

len(mockedRenderer.BuildPageCalls())

func (*RendererMock) NewBasePageModel added in v0.5.0

func (mock *RendererMock) NewBasePageModel() model.Page

NewBasePageModel calls NewBasePageModelFunc.

func (*RendererMock) NewBasePageModelCalls added in v0.5.0

func (mock *RendererMock) NewBasePageModelCalls() []struct {
}

NewBasePageModelCalls gets all the calls that were made to NewBasePageModel. Check the length with:

len(mockedRenderer.NewBasePageModelCalls())

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL