Initial cloud-services repo - gateway service + pkg modules
This commit is contained in:
32
pkg/db/queries/mocks/car_versions_log.go
Normal file
32
pkg/db/queries/mocks/car_versions_log.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package mocks
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"fiskerinc.com/modules/common"
|
||||
"fiskerinc.com/modules/db/queries"
|
||||
"github.com/go-pg/pg/v10/orm"
|
||||
)
|
||||
|
||||
type MockCarVersionsLog struct {
|
||||
MockLogVersionChange func(log *common.CarVersionLogs) (orm.Result, error)
|
||||
MockSelectByVIN func(vin string, options *queries.PageQueryOptions) ([]common.CarVersionLogs, int, error)
|
||||
GetCarVersionsResult map[string]string
|
||||
DBMockHelper
|
||||
}
|
||||
|
||||
func (m MockCarVersionsLog) LogVersionChange(log *common.CarVersionLogs) (orm.Result, error) {
|
||||
return m.MockLogVersionChange(log)
|
||||
}
|
||||
|
||||
func (m MockCarVersionsLog) SelectByVIN(vin string, options *queries.PageQueryOptions) ([]common.CarVersionLogs, int, error) {
|
||||
return m.MockSelectByVIN(vin, options)
|
||||
}
|
||||
|
||||
func (m MockCarVersionsLog) GetCarVersions(vin string, timestamp time.Time) (map[string]string, error) {
|
||||
if m.Error != nil {
|
||||
return nil, m.Error
|
||||
}
|
||||
|
||||
return m.GetCarVersionsResult, nil
|
||||
}
|
||||
Reference in New Issue
Block a user