Skip to content

Commit

Permalink
added methods to pipeline mock
Browse files Browse the repository at this point in the history
  • Loading branch information
mmelograno committed Aug 30, 2023
1 parent d66de49 commit 76db3ef
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions redis/mocks/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ type MockPipeline struct {
LLenCall func(key string)
HIncrByCall func(key string, field string, value int64)
HLenCall func(key string)
SetCall func(key string, value interface{}, expiration time.Duration)
IncrCall func(key string)
DecrCall func(key string)
SAddCall func(key string, members ...interface{})
SRemCall func(key string, members ...interface{})
ExecCall func() ([]redis.Result, error)
}

Expand All @@ -100,6 +105,26 @@ func (m *MockPipeline) HLen(key string) {
m.HLenCall(key)
}

func (m *MockPipeline) Set(key string, value interface{}, expiration time.Duration) {
m.SetCall(key, value, expiration)
}

func (m *MockPipeline) Incr(key string) {
m.IncrCall(key)
}

func (m *MockPipeline) Decr(key string) {
m.DecrCall(key)
}

func (m *MockPipeline) SAdd(key string, members ...interface{}) {
m.SAddCall(key, members...)
}

func (m *MockPipeline) SRem(key string, members ...interface{}) {
m.SRemCall(key, members...)
}

func (m *MockPipeline) Exec() ([]redis.Result, error) {
return m.ExecCall()
}
Expand Down

0 comments on commit 76db3ef

Please sign in to comment.