mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-07 04:09:15 +02:00
feat:#6 added tests with db for unused feed delete
This commit is contained in:
10
backend/service/functions/time/mockClock.go
Normal file
10
backend/service/functions/time/mockClock.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package time
|
||||
|
||||
import "time"
|
||||
|
||||
type MockClock struct {
|
||||
NowTime time.Time
|
||||
}
|
||||
|
||||
func (m MockClock) Now() time.Time { return m.NowTime }
|
||||
func (MockClock) After(d time.Duration) <-chan time.Time { return time.After(d) }
|
8
backend/service/functions/time/realClock.go
Normal file
8
backend/service/functions/time/realClock.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package time
|
||||
|
||||
import "time"
|
||||
|
||||
type RealClock struct{}
|
||||
|
||||
func (RealClock) Now() time.Time { return time.Now() }
|
||||
func (RealClock) After(d time.Duration) <-chan time.Time { return time.After(d) }
|
8
backend/service/functions/time/time.go
Normal file
8
backend/service/functions/time/time.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package time
|
||||
|
||||
import "time"
|
||||
|
||||
type Clock interface {
|
||||
Now() time.Time
|
||||
After(d time.Duration) <-chan time.Time
|
||||
}
|
Reference in New Issue
Block a user