feat: initial commit
This commit is contained in:
22
test/testutil/fake_message_gateway.go
Normal file
22
test/testutil/fake_message_gateway.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package testutil
|
||||
|
||||
import "context"
|
||||
|
||||
type FakeMessageGateway struct {
|
||||
LastSentText string
|
||||
LastChatID int64
|
||||
TypingChatIDs []int64
|
||||
SendError error
|
||||
TypingError error
|
||||
}
|
||||
|
||||
func (f *FakeMessageGateway) SendText(_ context.Context, chatID int64, text string) error {
|
||||
f.LastChatID = chatID
|
||||
f.LastSentText = text
|
||||
return f.SendError
|
||||
}
|
||||
|
||||
func (f *FakeMessageGateway) SendTyping(_ context.Context, chatID int64) error {
|
||||
f.TypingChatIDs = append(f.TypingChatIDs, chatID)
|
||||
return f.TypingError
|
||||
}
|
||||
Reference in New Issue
Block a user