feat: initial commit
This commit is contained in:
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/FernandoVideira/LK_API_Temp/internal/store"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
func NewMockCache() Storage {
|
||||
return Storage{
|
||||
Users: &MockUserStore{},
|
||||
}
|
||||
}
|
||||
|
||||
type MockUserStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (m *MockUserStore) Get(ctx context.Context, id int64) (*store.User, error) {
|
||||
args := m.Called(id)
|
||||
return nil, args.Error(1)
|
||||
}
|
||||
|
||||
func (m *MockUserStore) Set(ctx context.Context, user *store.User) error {
|
||||
args := m.Called(user)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *MockUserStore) Delete(ctx context.Context, id int64) error {
|
||||
args := m.Called(id)
|
||||
return args.Error(0)
|
||||
}
|
||||
Reference in New Issue
Block a user