-
Notifications
You must be signed in to change notification settings - Fork 0
/
repository_test.go
34 lines (26 loc) · 1.18 KB
/
repository_test.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
package ana
type emptyRepository struct {
}
func newEmptyRepository() *emptyRepository {
return &emptyRepository{}
}
func (repo *emptyRepository) FetchOrStart(Operation[mockedPayload, mockedResult, *mockedCtx]) *TrackedOperation[mockedPayload, mockedResult] {
return nil
}
func (repo *emptyRepository) NewSession(operation Operation[mockedPayload, mockedResult, *mockedCtx]) *Session[mockedPayload, mockedResult, *mockedCtx] {
return NewSession(operation, newMockedCtx())
}
type trackedOperationRepository struct {
trackedOperation *TrackedOperation[mockedPayload, mockedResult]
}
func newTrackedOperationRepository(trackedOperation *TrackedOperation[mockedPayload, mockedResult]) *trackedOperationRepository {
return &trackedOperationRepository{
trackedOperation: trackedOperation,
}
}
func (repo *trackedOperationRepository) FetchOrStart(operation Operation[mockedPayload, mockedResult, *mockedCtx]) *TrackedOperation[mockedPayload, mockedResult] {
return repo.trackedOperation
}
func (repo *trackedOperationRepository) NewSession(operation Operation[mockedPayload, mockedResult, *mockedCtx]) *Session[mockedPayload, mockedResult, *mockedCtx] {
return NewSession(operation, newMockedCtx())
}