mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-31 07:30:32 +00:00
refactor: make MockPDK private
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
1fdeb54961
commit
f8ea65dbc8
@ -10,19 +10,19 @@ package pdk
|
|||||||
|
|
||||||
import "github.com/stretchr/testify/mock"
|
import "github.com/stretchr/testify/mock"
|
||||||
|
|
||||||
// MockPDK is the mock implementation for testing PDK functions.
|
// mockPDK is the mock implementation for testing PDK functions.
|
||||||
type MockPDK struct {
|
type mockPDK struct {
|
||||||
mock.Mock
|
mock.Mock
|
||||||
}
|
}
|
||||||
|
|
||||||
// PDKMock is the auto-instantiated mock instance for testing.
|
// PDKMock is the auto-instantiated mock instance for testing.
|
||||||
// Use this to set expectations: pdk.PDKMock.On("GetConfig", "key").Return("value", true)
|
// Use this to set expectations: pdk.PDKMock.On("GetConfig", "key").Return("value", true)
|
||||||
var PDKMock = &MockPDK{}
|
var PDKMock = &mockPDK{}
|
||||||
|
|
||||||
// ResetMock resets the mock to its initial state.
|
// ResetMock resets the mock to its initial state.
|
||||||
// Call this in test setup/teardown to ensure clean state between tests.
|
// Call this in test setup/teardown to ensure clean state between tests.
|
||||||
func ResetMock() {
|
func ResetMock() {
|
||||||
PDKMock = &MockPDK{}
|
PDKMock = &mockPDK{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
|
|||||||
@ -10,19 +10,19 @@ package pdk
|
|||||||
|
|
||||||
import "github.com/stretchr/testify/mock"
|
import "github.com/stretchr/testify/mock"
|
||||||
|
|
||||||
// MockPDK is the mock implementation for testing PDK functions.
|
// mockPDK is the mock implementation for testing PDK functions.
|
||||||
type MockPDK struct {
|
type mockPDK struct {
|
||||||
mock.Mock
|
mock.Mock
|
||||||
}
|
}
|
||||||
|
|
||||||
// PDKMock is the auto-instantiated mock instance for testing.
|
// PDKMock is the auto-instantiated mock instance for testing.
|
||||||
// Use this to set expectations: pdk.PDKMock.On("GetConfig", "key").Return("value", true)
|
// Use this to set expectations: pdk.PDKMock.On("GetConfig", "key").Return("value", true)
|
||||||
var PDKMock = &MockPDK{}
|
var PDKMock = &mockPDK{}
|
||||||
|
|
||||||
// ResetMock resets the mock to its initial state.
|
// ResetMock resets the mock to its initial state.
|
||||||
// Call this in test setup/teardown to ensure clean state between tests.
|
// Call this in test setup/teardown to ensure clean state between tests.
|
||||||
func ResetMock() {
|
func ResetMock() {
|
||||||
PDKMock = &MockPDK{}
|
PDKMock = &mockPDK{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user