File size: 3,573 Bytes
7b9f3e3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | package storage
import (
"github.com/play-with-docker/play-with-docker/pwd/types"
"github.com/stretchr/testify/mock"
)
type Mock struct {
mock.Mock
}
func (m *Mock) SessionGet(id string) (*types.Session, error) {
args := m.Called(id)
return args.Get(0).(*types.Session), args.Error(1)
}
func (m *Mock) SessionGetAll() ([]*types.Session, error) {
args := m.Called()
return args.Get(0).([]*types.Session), args.Error(1)
}
func (m *Mock) SessionPut(session *types.Session) error {
args := m.Called(session)
return args.Error(0)
}
func (m *Mock) SessionDelete(id string) error {
args := m.Called(id)
return args.Error(0)
}
func (m *Mock) SessionCount() (int, error) {
args := m.Called()
return args.Int(0), args.Error(1)
}
func (m *Mock) InstanceGet(name string) (*types.Instance, error) {
args := m.Called(name)
return args.Get(0).(*types.Instance), args.Error(1)
}
func (m *Mock) InstancePut(instance *types.Instance) error {
args := m.Called(instance)
return args.Error(0)
}
func (m *Mock) InstanceDelete(name string) error {
args := m.Called(name)
return args.Error(0)
}
func (m *Mock) InstanceCount() (int, error) {
args := m.Called()
return args.Int(0), args.Error(1)
}
func (m *Mock) InstanceFindBySessionId(sessionId string) ([]*types.Instance, error) {
args := m.Called(sessionId)
return args.Get(0).([]*types.Instance), args.Error(1)
}
func (m *Mock) WindowsInstanceGetAll() ([]*types.WindowsInstance, error) {
args := m.Called()
return args.Get(0).([]*types.WindowsInstance), args.Error(1)
}
func (m *Mock) WindowsInstancePut(instance *types.WindowsInstance) error {
args := m.Called(instance)
return args.Error(0)
}
func (m *Mock) WindowsInstanceDelete(id string) error {
args := m.Called(id)
return args.Error(0)
}
func (m *Mock) ClientGet(id string) (*types.Client, error) {
args := m.Called(id)
return args.Get(0).(*types.Client), args.Error(1)
}
func (m *Mock) ClientPut(client *types.Client) error {
args := m.Called(client)
return args.Error(0)
}
func (m *Mock) ClientDelete(id string) error {
args := m.Called(id)
return args.Error(0)
}
func (m *Mock) ClientCount() (int, error) {
args := m.Called()
return args.Int(0), args.Error(1)
}
func (m *Mock) ClientFindBySessionId(sessionId string) ([]*types.Client, error) {
args := m.Called(sessionId)
return args.Get(0).([]*types.Client), args.Error(1)
}
func (m *Mock) LoginRequestPut(loginRequest *types.LoginRequest) error {
args := m.Called(loginRequest)
return args.Error(0)
}
func (m *Mock) LoginRequestGet(id string) (*types.LoginRequest, error) {
args := m.Called(id)
return args.Get(0).(*types.LoginRequest), args.Error(1)
}
func (m *Mock) LoginRequestDelete(id string) error {
args := m.Called(id)
return args.Error(0)
}
func (m *Mock) UserFindByProvider(providerName, providerUserId string) (*types.User, error) {
args := m.Called(providerName, providerUserId)
return args.Get(0).(*types.User), args.Error(1)
}
func (m *Mock) UserPut(user *types.User) error {
args := m.Called(user)
return args.Error(0)
}
func (m *Mock) UserGet(id string) (*types.User, error) {
args := m.Called(id)
return args.Get(0).(*types.User), args.Error(1)
}
func (m *Mock) PlaygroundPut(playground *types.Playground) error {
args := m.Called(playground)
return args.Error(0)
}
func (m *Mock) PlaygroundGet(id string) (*types.Playground, error) {
args := m.Called(id)
return args.Get(0).(*types.Playground), args.Error(1)
}
func (m *Mock) PlaygroundGetAll() ([]*types.Playground, error) {
args := m.Called()
return args.Get(0).([]*types.Playground), args.Error(1)
}
|