mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-03 10:22:14 +00:00
28 lines
571 B
Go
28 lines
571 B
Go
|
|
package mock
|
||
|
|
|
||
|
|
import (
|
||
|
|
"testing"
|
||
|
|
|
||
|
|
"github.com/golang/mock/gomock"
|
||
|
|
)
|
||
|
|
|
||
|
|
func NewIDGenerator(t *testing.T) *MockGenerator {
|
||
|
|
m := NewMockGenerator(gomock.NewController(t))
|
||
|
|
m.EXPECT().Next().Return("1", nil)
|
||
|
|
return m
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewIDGeneratorExpectIDs(t *testing.T, ids ...string) *MockGenerator {
|
||
|
|
m := NewMockGenerator(gomock.NewController(t))
|
||
|
|
for _, id := range ids {
|
||
|
|
m.EXPECT().Next().Return(id, nil)
|
||
|
|
}
|
||
|
|
return m
|
||
|
|
}
|
||
|
|
|
||
|
|
func ExpectID(t *testing.T, id string) *MockGenerator {
|
||
|
|
m := NewMockGenerator(gomock.NewController(t))
|
||
|
|
m.EXPECT().Next().Return(id, nil)
|
||
|
|
return m
|
||
|
|
}
|