Documentation ¶
Overview ¶
FILE AUTOMATICALLY GENERATED. ADAPTER TO USE GENERICS
Index ¶
- Variables
- func AssertBadRequestError(t *testing.T, w *httptest.ResponseRecorder)
- func AssertDocumentNotFound(t *testing.T, w *httptest.ResponseRecorder)
- func AssertInternalServerError(t *testing.T, w *httptest.ResponseRecorder)
- func AssertUnauthorized(t *testing.T, w *httptest.ResponseRecorder)
- func DefaultMockRabbitChannel(ctrl *gomock.Controller, times int) *mockgen.MockRabbitChannel
- func ExpectFindOne[T any](coll *mockgen.MockCollection, userData *T, times int)
- func ExpectFindOneError(coll *mockgen.MockCollection, err error, times int)
- func ExpectInsertOne(coll *mockgen.MockCollection, times int)
- func ExpectInsertOneError(coll *mockgen.MockCollection, err error, times int)
- func ExpectUpdateOneError(coll *mockgen.MockCollection, err error, times int)
- func NewTestLogger(ctrl *gomock.Controller, withFieldCount int, errorCount int, infoCount int, ...) log.LogRusEntry
- func TestGetRequest(url string, tokenString string) (*http.Request, *httptest.ResponseRecorder)
- func TestPostRequest(url string, body interface{}, tokenString string) (*http.Request, *httptest.ResponseRecorder)
- type MockCache
- type MockCacheMockRecorder
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
Requests Test functions
func TestPostRequest ¶ added in v0.0.2
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]) EXPECT ¶
func (m *MockCache[T]) EXPECT() *MockCacheMockRecorder[T]
EXPECT returns an object that allows the caller to indicate expected use.
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.
Click to show internal directories.
Click to hide internal directories.