mocking

package
v1.7.0-preview20241103 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockClient

type MockClient struct {
	mock.Mock
}

func (*MockClient) GetBaseURL

func (c *MockClient) GetBaseURL() string

func (*MockClient) Send

func (c *MockClient) Send(requestInfo core.RequestInformation, errorMapping core.ErrorMapping) (*http.Response, error)

func (*MockClient) SendWithContext

func (c *MockClient) SendWithContext(ctx context.Context, requestInfo core.RequestInformation, errorMapping core.ErrorMapping) (*http.Response, error)

type MockRequestInformation

type MockRequestInformation struct {
	mock.Mock
}

func (*MockRequestInformation) AddHeaders

func (m *MockRequestInformation) AddHeaders(headers interface{}) error

func (*MockRequestInformation) AddQueryParameters

func (m *MockRequestInformation) AddQueryParameters(params interface{}) error

func (*MockRequestInformation) GetContent

func (m *MockRequestInformation) GetContent() []byte

func (*MockRequestInformation) GetHeaders

func (m *MockRequestInformation) GetHeaders() core.RequestHeader

func (*MockRequestInformation) GetMethod

func (m *MockRequestInformation) GetMethod() string

func (*MockRequestInformation) SetContent

func (m *MockRequestInformation) SetContent(content []byte, contentType string)

func (*MockRequestInformation) SetStreamContent

func (m *MockRequestInformation) SetStreamContent(data []byte)

func (*MockRequestInformation) SetUri

func (m *MockRequestInformation) SetUri(uri *url.URL)

func (*MockRequestInformation) ToRequest

func (m *MockRequestInformation) ToRequest() (*http.Request, error)

func (*MockRequestInformation) ToRequestWithContext

func (m *MockRequestInformation) ToRequestWithContext(ctx context.Context) (*http.Request, error)

func (*MockRequestInformation) Url

func (m *MockRequestInformation) Url() (string, error)

type Test

type Test[T any] struct {
	Title string
	// Setup to make needed modifications for a specific test
	Setup func()
	// Cleanup to undo changes do to reusable items
	Cleanup     func()
	Input       interface{}
	Expected    T
	ExpectedErr error
}

Jump to

Keyboard shortcuts

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