package mocks

import "github.com/input-output-hk/catalyst-forge/lib/blueprint/pkg/injector/mocks"

Index

Types

type EnvGetterMock

type EnvGetterMock struct {
	// GetFunc mocks the Get method.
	GetFunc func(key string) (string, bool)
	// contains filtered or unexported fields
}

EnvGetterMock is a mock implementation of injector.EnvGetter.

func TestSomethingThatUsesEnvGetter(t *testing.T) {

	// make and configure a mocked injector.EnvGetter
	mockedEnvGetter := &EnvGetterMock{
		GetFunc: func(key string) (string, bool) {
			panic("mock out the Get method")
		},
	}

	// use mockedEnvGetter in code that requires injector.EnvGetter
	// and then make assertions.

}

func (*EnvGetterMock) Get

func (mock *EnvGetterMock) Get(key string) (string, bool)

Get calls GetFunc.

func (*EnvGetterMock) GetCalls

func (mock *EnvGetterMock) GetCalls() []struct {
	Key string
}

GetCalls gets all the calls that were made to Get. Check the length with:

len(mockedEnvGetter.GetCalls())

Source Files

injector.go

Version
v0.0.0-20240928203643-c3373f0052b9 (latest)
Published
Sep 28, 2024
Platform
linux/amd64
Imports
1 packages
Last checked
2 days ago

Tools for package owners.