diff --git a/internal/services/bot/bot_all/bot_test.go b/internal/services/bot/bot_all/bot_test.go index 8876e1b..511f650 100644 --- a/internal/services/bot/bot_all/bot_test.go +++ b/internal/services/bot/bot_all/bot_test.go @@ -30,7 +30,7 @@ func Test_botAll_Process(t *testing.T) { }, storage: func(ctrl *gomock.Controller) storage.IStorage { m := storage_mocks.NewMockIStorage(ctrl) - m.EXPECT().UpsertUser(gomock.Any(), storage.User{ChatID: "123", UserID: "username"}).Times(1) + m.EXPECT().UpsertUser(gomock.Any(), &storage.User{ChatID: "123", UserID: "username"}).Times(1) m.EXPECT().GetAllUsersByChatID(gomock.Any(), gomock.Any()).Times(0) return m }, @@ -50,10 +50,10 @@ func Test_botAll_Process(t *testing.T) { }, storage: func(ctrl *gomock.Controller) storage.IStorage { m := storage_mocks.NewMockIStorage(ctrl) - m.EXPECT().UpsertUser(gomock.Any(), storage.User{ChatID: "123", UserID: "username"}).Times(1) + m.EXPECT().UpsertUser(gomock.Any(), &storage.User{ChatID: "123", UserID: "username"}).Times(1) m.EXPECT(). GetAllUsersByChatID(gomock.Any(), gomock.Any()). - Return([]storage.User{{UserID: "username"}}, nil). + Return([]*storage.User{{UserID: "username"}}, nil). Times(1) return m }, @@ -73,7 +73,7 @@ func Test_botAll_Process(t *testing.T) { gomock.Any(), &messenger.Message{ ChatID: "123", - Text: "username2", + Text: "@username2", }, ). Times(1) @@ -81,10 +81,10 @@ func Test_botAll_Process(t *testing.T) { }, storage: func(ctrl *gomock.Controller) storage.IStorage { m := storage_mocks.NewMockIStorage(ctrl) - m.EXPECT().UpsertUser(gomock.Any(), storage.User{ChatID: "123", UserID: "username"}).Times(1) + m.EXPECT().UpsertUser(gomock.Any(), &storage.User{ChatID: "123", UserID: "username"}).Times(1) m.EXPECT(). GetAllUsersByChatID(gomock.Any(), gomock.Any()). - Return([]storage.User{ + Return([]*storage.User{ {UserID: "username"}, {UserID: "username2"}, }, nil). @@ -107,7 +107,7 @@ func Test_botAll_Process(t *testing.T) { gomock.Any(), &messenger.Message{ ChatID: "123", - Text: "username2 username3", + Text: "@username2 @username3", }, ). Times(1) @@ -115,10 +115,10 @@ func Test_botAll_Process(t *testing.T) { }, storage: func(ctrl *gomock.Controller) storage.IStorage { m := storage_mocks.NewMockIStorage(ctrl) - m.EXPECT().UpsertUser(gomock.Any(), storage.User{ChatID: "123", UserID: "username"}).Times(1) + m.EXPECT().UpsertUser(gomock.Any(), &storage.User{ChatID: "123", UserID: "username"}).Times(1) m.EXPECT(). GetAllUsersByChatID(gomock.Any(), gomock.Any()). - Return([]storage.User{ + Return([]*storage.User{ {UserID: "username"}, {UserID: "username2"}, {UserID: "username3"},