WIP: Separate test. Refactor a bunch of it.

This commit is contained in:
Ilja Lapkovskis 2024-01-18 22:45:49 +02:00
parent 63e5c59035
commit f70bd7e672
No known key found for this signature in database
GPG key ID: 53D2AA4F0D1079C4
6 changed files with 2170 additions and 982 deletions

55
bot_mock_test.go Normal file
View file

@ -0,0 +1,55 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: bot.go
//
// Generated by this command:
//
// mockgen -destination=bot_mock_test.go -package=tgbotapi -source=bot.go
//
// Package tgbotapi is a generated GoMock package.
package tgbotapi
import (
http "net/http"
reflect "reflect"
gomock "go.uber.org/mock/gomock"
)
// MockHTTPClient is a mock of HTTPClient interface.
type MockHTTPClient struct {
ctrl *gomock.Controller
recorder *MockHTTPClientMockRecorder
}
// MockHTTPClientMockRecorder is the mock recorder for MockHTTPClient.
type MockHTTPClientMockRecorder struct {
mock *MockHTTPClient
}
// NewMockHTTPClient creates a new mock instance.
func NewMockHTTPClient(ctrl *gomock.Controller) *MockHTTPClient {
mock := &MockHTTPClient{ctrl: ctrl}
mock.recorder = &MockHTTPClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockHTTPClient) EXPECT() *MockHTTPClientMockRecorder {
return m.recorder
}
// Do mocks base method.
func (m *MockHTTPClient) Do(req *http.Request) (*http.Response, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Do", req)
ret0, _ := ret[0].(*http.Response)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Do indicates an expected call of Do.
func (mr *MockHTTPClientMockRecorder) Do(req any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Do", reflect.TypeOf((*MockHTTPClient)(nil).Do), req)
}