Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.

Commit 6d5e81f

Browse files
committed
fix: added MockSharedUserMessageItem
1 parent 3e9a2c5 commit 6d5e81f

File tree

3 files changed

+137
-0
lines changed

3 files changed

+137
-0
lines changed

generate_mocks.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ mockgen github.com/bots-go-framework/bots-fw/botinput WebhookEntry > mock_botinp
66
mockgen github.com/bots-go-framework/bots-fw/botinput WebhookInput > mock_botinput/webook_input.go
77
mockgen github.com/bots-go-framework/bots-fw/botinput WebhookUser > mock_botinput/webook_user.go
88
mockgen github.com/bots-go-framework/bots-fw/botinput WebhookSender > mock_botinput/webook_sender.go
9+
mockgen github.com/bots-go-framework/bots-fw/botinput SharedUserMessageItem > mock_botinput/webook_shared_user_message_item.go
910
mockgen github.com/bots-go-framework/bots-fw/botinput WebhookSharedUsersMessage > mock_botinput/webook_shared_users_message.go
1011
mockgen github.com/bots-go-framework/bots-fw/botinput WebhookMessage > mock_botinput/webook_message.go
1112
mockgen github.com/bots-go-framework/bots-fw/botinput WebhookTextMessage > mock_botinput/webook_text_message.go

mock_botinput/webook_shared_user_message_item.go

Lines changed: 111 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package mock_botinput
2+
3+
import (
4+
"github.com/bots-go-framework/bots-fw/botinput"
5+
"go.uber.org/mock/gomock"
6+
"testing"
7+
)
8+
9+
func TestNewMockWebhookSharedUsersMessage(t *testing.T) {
10+
ctrl := gomock.NewController(t)
11+
mockM := NewMockWebhookSharedUsersMessage(ctrl)
12+
if mockM == nil {
13+
t.Fatalf("NewMockWebhookSharedUsersMessage returned nil")
14+
}
15+
expectedSharedUsers := []botinput.SharedUserMessageItem{
16+
NewMockSharedUserMessageItem(ctrl),
17+
}
18+
mockM.EXPECT().GetSharedUsers().Return(expectedSharedUsers)
19+
var m botinput.WebhookSharedUsersMessage = mockM
20+
if sharedUser := m.GetSharedUsers(); sharedUser == nil {
21+
t.Fatalf("GetSharedUsers returned nil")
22+
} else if sharedUser[0] != expectedSharedUsers[0] {
23+
t.Fatalf("GetSharedUsers returned unxpcted result %v", sharedUser)
24+
}
25+
}

0 commit comments

Comments
 (0)