forked from content-services/content-sources-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
registry_mock.go
38 lines (34 loc) · 940 Bytes
/
registry_mock.go
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
package dao
import (
"testing"
)
type MockDaoRegistry struct {
RepositoryConfig MockRepositoryConfigDao
Rpm MockRpmDao
Repository MockRepositoryDao
Metrics MockMetricsDao
Snapshot MockSnapshotDao
TaskInfo MockTaskInfoDao
}
func (m *MockDaoRegistry) ToDaoRegistry() *DaoRegistry {
r := DaoRegistry{
RepositoryConfig: &m.RepositoryConfig,
Rpm: &m.Rpm,
Repository: &m.Repository,
Metrics: &m.Metrics,
Snapshot: &m.Snapshot,
TaskInfo: &m.TaskInfo,
}
return &r
}
func GetMockDaoRegistry(t *testing.T) *MockDaoRegistry {
reg := MockDaoRegistry{
RepositoryConfig: *NewMockRepositoryConfigDao(t),
Rpm: *NewMockRpmDao(t),
Repository: *NewMockRepositoryDao(t),
Metrics: *NewMockMetricsDao(t),
Snapshot: *NewMockSnapshotDao(t),
TaskInfo: *NewMockTaskInfoDao(t),
}
return ®
}