mktools

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: GPL-3.0 Imports: 12 Imported by: 1

Documentation

Overview

FILE AUTOMATICALLY GENERATED. ADAPTER TO USE GENERICS

Index

Constants

This section is empty.

Variables

View Source
var TestIsUniqueError = mongo.WriteException{
	WriteErrors: []mongo.WriteError{
		{
			Code: 11000,
		},
	},
}

Mock Data

View Source
var TestOtherDbError = mongo.WriteException{
	WriteErrors: []mongo.WriteError{
		{
			Code: 1,
		},
	},
}

Functions

func AssertBadRequestError added in v0.0.2

func AssertBadRequestError(t *testing.T, w *httptest.ResponseRecorder)

func AssertDocumentNotFound added in v0.0.2

func AssertDocumentNotFound(t *testing.T, w *httptest.ResponseRecorder)

func AssertInternalServerError added in v0.0.2

func AssertInternalServerError(t *testing.T, w *httptest.ResponseRecorder)

func AssertUnauthorized added in v0.0.2

func AssertUnauthorized(t *testing.T, w *httptest.ResponseRecorder)

Assertion Functions

func DefaultMockRabbitChannel

func DefaultMockRabbitChannel(ctrl *gomock.Controller, times int) *mockgen.MockRabbitChannel

func ExpectFindOne added in v0.0.3

func ExpectFindOne[T any](coll *mockgen.MockCollection, userData *T, times int)

func ExpectFindOneError

func ExpectFindOneError(coll *mockgen.MockCollection, err error, times int)

func ExpectInsertOne

func ExpectInsertOne(coll *mockgen.MockCollection, times int)

func ExpectInsertOneError

func ExpectInsertOneError(coll *mockgen.MockCollection, err error, times int)

func ExpectUpdateOneError

func ExpectUpdateOneError(coll *mockgen.MockCollection, err error, times int)

func NewTestLogger

func NewTestLogger(ctrl *gomock.Controller, withFieldCount int, errorCount int, infoCount int, dataCount int, warnCount int, fatalCount int) log.LogRusEntry

func TestGetRequest added in v0.0.2

func TestGetRequest(url string, tokenString string) (*http.Request, *httptest.ResponseRecorder)

Requests Test functions

func TestPostRequest added in v0.0.2

func TestPostRequest(url string, body interface{}, tokenString string) (*http.Request, *httptest.ResponseRecorder)

Types

type MockCache

type MockCache[T any] struct {
	// contains filtered or unexported fields
}

MockCache is a mock of Cache interface.

func NewMockCache

func NewMockCache[T any](ctrl *gomock.Controller) *MockCache[T]

NewMockCache creates a new mock instance.

func (*MockCache[T]) Add

func (m *MockCache[T]) Add(key string, value *T) error

Add mocks base method.

func (*MockCache[T]) EXPECT

func (m *MockCache[T]) EXPECT() *MockCacheMockRecorder[T]

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCache[T]) Get

func (m *MockCache[T]) Get(key string) (*T, error)

Get mocks base method.

func (*MockCache[T]) Remove

func (m *MockCache[T]) Remove(key string)

Remove mocks base method.

type MockCacheMockRecorder

type MockCacheMockRecorder[T any] struct {
	// contains filtered or unexported fields
}

MockCacheMockRecorder is the mock recorder for MockCache.

func (*MockCacheMockRecorder[T]) Add

func (mr *MockCacheMockRecorder[T]) Add(key, value interface{}) *gomock.Call

Add indicates an expected call of Add.

func (*MockCacheMockRecorder[T]) Get

func (mr *MockCacheMockRecorder[T]) Get(key interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockCacheMockRecorder[T]) Remove

func (mr *MockCacheMockRecorder[T]) Remove(key interface{}) *gomock.Call

Remove indicates an expected call of Remove.

Jump to

Keyboard shortcuts

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