Documentation ¶
Index ¶
- func CommitErrTx(t *testing.T) radio.StorageTx
- func CommitTx(t *testing.T) radio.StorageTx
- func NotUsedTx(t *testing.T) radio.StorageTx
- func RollbackTx(t *testing.T) radio.StorageTx
- type ExecutorMock
- func (mock *ExecutorMock) Execute(w io.Writer, r *http.Request, input templates.TemplateSelectable) error
- func (mock *ExecutorMock) ExecuteAll(input templates.TemplateSelectable) (map[string][]byte, error)
- func (mock *ExecutorMock) ExecuteAllCalls() []struct{ ... }
- func (mock *ExecutorMock) ExecuteCalls() []struct{ ... }
- func (mock *ExecutorMock) ExecuteTemplate(ctx context.Context, theme string, page string, template string, ...) error
- func (mock *ExecutorMock) ExecuteTemplateCalls() []struct{ ... }
- type FS
- type FSMock
- func (mock *FSMock) Glob(pattern string) ([]string, error)
- func (mock *FSMock) GlobCalls() []struct{ ... }
- func (mock *FSMock) Open(name string) (fs.File, error)
- func (mock *FSMock) OpenCalls() []struct{ ... }
- func (mock *FSMock) ReadFile(name string) ([]byte, error)
- func (mock *FSMock) ReadFileCalls() []struct{ ... }
- func (mock *FSMock) Stat(name string) (fs.FileInfo, error)
- func (mock *FSMock) StatCalls() []struct{ ... }
- func (mock *FSMock) Sub(dir string) (fs.FS, error)
- func (mock *FSMock) SubCalls() []struct{ ... }
- type File
- type FileInfo
- type FileInfoMock
- func (mock *FileInfoMock) IsDir() bool
- func (mock *FileInfoMock) IsDirCalls() []struct{}
- func (mock *FileInfoMock) ModTime() time.Time
- func (mock *FileInfoMock) ModTimeCalls() []struct{}
- func (mock *FileInfoMock) Mode() fs.FileMode
- func (mock *FileInfoMock) ModeCalls() []struct{}
- func (mock *FileInfoMock) Name() string
- func (mock *FileInfoMock) NameCalls() []struct{}
- func (mock *FileInfoMock) Size() int64
- func (mock *FileInfoMock) SizeCalls() []struct{}
- func (mock *FileInfoMock) Sys() any
- func (mock *FileInfoMock) SysCalls() []struct{}
- type FileMock
- type ManagerServiceMock
- func (mock *ManagerServiceMock) CurrentListeners(contextMoqParam context.Context) (eventstream.Stream[int64], error)
- func (mock *ManagerServiceMock) CurrentListenersCalls() []struct{ ... }
- func (mock *ManagerServiceMock) CurrentSong(contextMoqParam context.Context) (eventstream.Stream[*radio.SongUpdate], error)
- func (mock *ManagerServiceMock) CurrentSongCalls() []struct{ ... }
- func (mock *ManagerServiceMock) CurrentStatus(contextMoqParam context.Context) (eventstream.Stream[radio.Status], error)
- func (mock *ManagerServiceMock) CurrentStatusCalls() []struct{ ... }
- func (mock *ManagerServiceMock) CurrentThread(contextMoqParam context.Context) (eventstream.Stream[string], error)
- func (mock *ManagerServiceMock) CurrentThreadCalls() []struct{ ... }
- func (mock *ManagerServiceMock) CurrentUser(contextMoqParam context.Context) (eventstream.Stream[*radio.User], error)
- func (mock *ManagerServiceMock) CurrentUserCalls() []struct{ ... }
- func (mock *ManagerServiceMock) UpdateListeners(contextMoqParam context.Context, n int64) error
- func (mock *ManagerServiceMock) UpdateListenersCalls() []struct{ ... }
- func (mock *ManagerServiceMock) UpdateSong(contextMoqParam context.Context, songUpdate *radio.SongUpdate) error
- func (mock *ManagerServiceMock) UpdateSongCalls() []struct{ ... }
- func (mock *ManagerServiceMock) UpdateThread(contextMoqParam context.Context, s string) error
- func (mock *ManagerServiceMock) UpdateThreadCalls() []struct{ ... }
- func (mock *ManagerServiceMock) UpdateUser(contextMoqParam context.Context, user *radio.User) error
- func (mock *ManagerServiceMock) UpdateUserCalls() []struct{ ... }
- type StorageServiceMock
- func (mock *StorageServiceMock) News(contextMoqParam context.Context) radio.NewsStorage
- func (mock *StorageServiceMock) NewsCalls() []struct{ ... }
- func (mock *StorageServiceMock) NewsTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.NewsStorage, radio.StorageTx, error)
- func (mock *StorageServiceMock) NewsTxCalls() []struct{ ... }
- func (mock *StorageServiceMock) Queue(contextMoqParam context.Context) radio.QueueStorage
- func (mock *StorageServiceMock) QueueCalls() []struct{ ... }
- func (mock *StorageServiceMock) QueueTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.QueueStorage, radio.StorageTx, error)
- func (mock *StorageServiceMock) QueueTxCalls() []struct{ ... }
- func (mock *StorageServiceMock) Relay(contextMoqParam context.Context) radio.RelayStorage
- func (mock *StorageServiceMock) RelayCalls() []struct{ ... }
- func (mock *StorageServiceMock) RelayTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.RelayStorage, radio.StorageTx, error)
- func (mock *StorageServiceMock) RelayTxCalls() []struct{ ... }
- func (mock *StorageServiceMock) Request(contextMoqParam context.Context) radio.RequestStorage
- func (mock *StorageServiceMock) RequestCalls() []struct{ ... }
- func (mock *StorageServiceMock) RequestTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.RequestStorage, radio.StorageTx, error)
- func (mock *StorageServiceMock) RequestTxCalls() []struct{ ... }
- func (mock *StorageServiceMock) Schedule(contextMoqParam context.Context) radio.ScheduleStorage
- func (mock *StorageServiceMock) ScheduleCalls() []struct{ ... }
- func (mock *StorageServiceMock) ScheduleTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.ScheduleStorage, radio.StorageTx, error)
- func (mock *StorageServiceMock) ScheduleTxCalls() []struct{ ... }
- func (mock *StorageServiceMock) Sessions(contextMoqParam context.Context) radio.SessionStorage
- func (mock *StorageServiceMock) SessionsCalls() []struct{ ... }
- func (mock *StorageServiceMock) SessionsTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.SessionStorage, radio.StorageTx, error)
- func (mock *StorageServiceMock) SessionsTxCalls() []struct{ ... }
- func (mock *StorageServiceMock) Song(contextMoqParam context.Context) radio.SongStorage
- func (mock *StorageServiceMock) SongCalls() []struct{ ... }
- func (mock *StorageServiceMock) SongTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.SongStorage, radio.StorageTx, error)
- func (mock *StorageServiceMock) SongTxCalls() []struct{ ... }
- func (mock *StorageServiceMock) Status(contextMoqParam context.Context) radio.StatusStorage
- func (mock *StorageServiceMock) StatusCalls() []struct{ ... }
- func (mock *StorageServiceMock) Submissions(contextMoqParam context.Context) radio.SubmissionStorage
- func (mock *StorageServiceMock) SubmissionsCalls() []struct{ ... }
- func (mock *StorageServiceMock) SubmissionsTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.SubmissionStorage, radio.StorageTx, error)
- func (mock *StorageServiceMock) SubmissionsTxCalls() []struct{ ... }
- func (mock *StorageServiceMock) Track(contextMoqParam context.Context) radio.TrackStorage
- func (mock *StorageServiceMock) TrackCalls() []struct{ ... }
- func (mock *StorageServiceMock) TrackTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.TrackStorage, radio.StorageTx, error)
- func (mock *StorageServiceMock) TrackTxCalls() []struct{ ... }
- func (mock *StorageServiceMock) User(contextMoqParam context.Context) radio.UserStorage
- func (mock *StorageServiceMock) UserCalls() []struct{ ... }
- func (mock *StorageServiceMock) UserTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.UserStorage, radio.StorageTx, error)
- func (mock *StorageServiceMock) UserTxCalls() []struct{ ... }
- type StorageTxMock
- type SubmissionStorageMock
- func (mock *SubmissionStorageMock) All() ([]radio.PendingSong, error)
- func (mock *SubmissionStorageMock) AllCalls() []struct{}
- func (mock *SubmissionStorageMock) GetSubmission(submissionID radio.SubmissionID) (*radio.PendingSong, error)
- func (mock *SubmissionStorageMock) GetSubmissionCalls() []struct{ ... }
- func (mock *SubmissionStorageMock) InsertPostPending(pendingSong radio.PendingSong) error
- func (mock *SubmissionStorageMock) InsertPostPendingCalls() []struct{ ... }
- func (mock *SubmissionStorageMock) InsertSubmission(pendingSong radio.PendingSong) error
- func (mock *SubmissionStorageMock) InsertSubmissionCalls() []struct{ ... }
- func (mock *SubmissionStorageMock) LastSubmissionTime(identifier string) (time.Time, error)
- func (mock *SubmissionStorageMock) LastSubmissionTimeCalls() []struct{ ... }
- func (mock *SubmissionStorageMock) RemoveSubmission(submissionID radio.SubmissionID) error
- func (mock *SubmissionStorageMock) RemoveSubmissionCalls() []struct{ ... }
- func (mock *SubmissionStorageMock) SubmissionStats(identifier string) (radio.SubmissionStats, error)
- func (mock *SubmissionStorageMock) SubmissionStatsCalls() []struct{ ... }
- func (mock *SubmissionStorageMock) UpdateSubmissionTime(identifier string) error
- func (mock *SubmissionStorageMock) UpdateSubmissionTimeCalls() []struct{ ... }
- type TemplateSelectableMock
- type TrackStorageMock
- func (mock *TrackStorageMock) All() ([]radio.Song, error)
- func (mock *TrackStorageMock) AllCalls() []struct{}
- func (mock *TrackStorageMock) BeforeLastRequested(before time.Time) ([]radio.Song, error)
- func (mock *TrackStorageMock) BeforeLastRequestedCalls() []struct{ ... }
- func (mock *TrackStorageMock) DecrementRequestCount(before time.Time) error
- func (mock *TrackStorageMock) DecrementRequestCountCalls() []struct{ ... }
- func (mock *TrackStorageMock) Delete(trackID radio.TrackID) error
- func (mock *TrackStorageMock) DeleteCalls() []struct{ ... }
- func (mock *TrackStorageMock) Get(trackID radio.TrackID) (*radio.Song, error)
- func (mock *TrackStorageMock) GetCalls() []struct{ ... }
- func (mock *TrackStorageMock) Insert(song radio.Song) (radio.TrackID, error)
- func (mock *TrackStorageMock) InsertCalls() []struct{ ... }
- func (mock *TrackStorageMock) QueueCandidates() ([]radio.TrackID, error)
- func (mock *TrackStorageMock) QueueCandidatesCalls() []struct{}
- func (mock *TrackStorageMock) Unusable() ([]radio.Song, error)
- func (mock *TrackStorageMock) UnusableCalls() []struct{}
- func (mock *TrackStorageMock) UpdateLastPlayed(trackID radio.TrackID) error
- func (mock *TrackStorageMock) UpdateLastPlayedCalls() []struct{ ... }
- func (mock *TrackStorageMock) UpdateLastRequested(trackID radio.TrackID) error
- func (mock *TrackStorageMock) UpdateLastRequestedCalls() []struct{ ... }
- func (mock *TrackStorageMock) UpdateMetadata(song radio.Song) error
- func (mock *TrackStorageMock) UpdateMetadataCalls() []struct{ ... }
- func (mock *TrackStorageMock) UpdateRequestInfo(trackID radio.TrackID) error
- func (mock *TrackStorageMock) UpdateRequestInfoCalls() []struct{ ... }
- func (mock *TrackStorageMock) UpdateUsable(song radio.Song, state radio.TrackState) error
- func (mock *TrackStorageMock) UpdateUsableCalls() []struct{ ... }
- type UserStorageMock
- func (mock *UserStorageMock) All() ([]radio.User, error)
- func (mock *UserStorageMock) AllCalls() []struct{}
- func (mock *UserStorageMock) ByNick(nick string) (*radio.User, error)
- func (mock *UserStorageMock) ByNickCalls() []struct{ ... }
- func (mock *UserStorageMock) Get(name string) (*radio.User, error)
- func (mock *UserStorageMock) GetByDJID(dJID radio.DJID) (*radio.User, error)
- func (mock *UserStorageMock) GetByDJIDCalls() []struct{ ... }
- func (mock *UserStorageMock) GetCalls() []struct{ ... }
- func (mock *UserStorageMock) LookupName(name string) (*radio.User, error)
- func (mock *UserStorageMock) LookupNameCalls() []struct{ ... }
- func (mock *UserStorageMock) Permissions() ([]radio.UserPermission, error)
- func (mock *UserStorageMock) PermissionsCalls() []struct{}
- func (mock *UserStorageMock) RecordListeners(n int64, user radio.User) error
- func (mock *UserStorageMock) RecordListenersCalls() []struct{ ... }
- func (mock *UserStorageMock) UpdateUser(user radio.User) (radio.User, error)
- func (mock *UserStorageMock) UpdateUserCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitErrTx ¶
CommitErrTx is a helper function to create a mocked StorageTx that has the Commit return an error
func CommitTx ¶
CommitTx is a helper function to create a mocked StorageTx that expects to be committed, it errors if a Rollback occurs before a Commit
Types ¶
type ExecutorMock ¶
type ExecutorMock struct { // ExecuteFunc mocks the Execute method. ExecuteFunc func(w io.Writer, r *http.Request, input templates.TemplateSelectable) error // ExecuteAllFunc mocks the ExecuteAll method. ExecuteAllFunc func(input templates.TemplateSelectable) (map[string][]byte, error) // ExecuteTemplateFunc mocks the ExecuteTemplate method. ExecuteTemplateFunc func(ctx context.Context, theme string, page string, template string, output io.Writer, input any) error // contains filtered or unexported fields }
ExecutorMock is a mock implementation of templates.Executor.
func TestSomethingThatUsesExecutor(t *testing.T) { // make and configure a mocked templates.Executor mockedExecutor := &ExecutorMock{ ExecuteFunc: func(w io.Writer, r *http.Request, input templates.TemplateSelectable) error { panic("mock out the Execute method") }, ExecuteAllFunc: func(input templates.TemplateSelectable) (map[string][]byte, error) { panic("mock out the ExecuteAll method") }, ExecuteTemplateFunc: func(ctx context.Context, theme string, page string, template string, output io.Writer, input any) error { panic("mock out the ExecuteTemplate method") }, } // use mockedExecutor in code that requires templates.Executor // and then make assertions. }
func (*ExecutorMock) Execute ¶
func (mock *ExecutorMock) Execute(w io.Writer, r *http.Request, input templates.TemplateSelectable) error
Execute calls ExecuteFunc.
func (*ExecutorMock) ExecuteAll ¶
func (mock *ExecutorMock) ExecuteAll(input templates.TemplateSelectable) (map[string][]byte, error)
ExecuteAll calls ExecuteAllFunc.
func (*ExecutorMock) ExecuteAllCalls ¶
func (mock *ExecutorMock) ExecuteAllCalls() []struct { Input templates.TemplateSelectable }
ExecuteAllCalls gets all the calls that were made to ExecuteAll. Check the length with:
len(mockedExecutor.ExecuteAllCalls())
func (*ExecutorMock) ExecuteCalls ¶
func (mock *ExecutorMock) ExecuteCalls() []struct { W io.Writer R *http.Request Input templates.TemplateSelectable }
ExecuteCalls gets all the calls that were made to Execute. Check the length with:
len(mockedExecutor.ExecuteCalls())
func (*ExecutorMock) ExecuteTemplate ¶
func (mock *ExecutorMock) ExecuteTemplate(ctx context.Context, theme string, page string, template string, output io.Writer, input any) error
ExecuteTemplate calls ExecuteTemplateFunc.
func (*ExecutorMock) ExecuteTemplateCalls ¶
func (mock *ExecutorMock) ExecuteTemplateCalls() []struct { Ctx context.Context Theme string Page string Template string Output io.Writer Input any }
ExecuteTemplateCalls gets all the calls that were made to ExecuteTemplate. Check the length with:
len(mockedExecutor.ExecuteTemplateCalls())
type FSMock ¶
type FSMock struct { // GlobFunc mocks the Glob method. GlobFunc func(pattern string) ([]string, error) // OpenFunc mocks the Open method. OpenFunc func(name string) (fs.File, error) // ReadFileFunc mocks the ReadFile method. ReadFileFunc func(name string) ([]byte, error) // StatFunc mocks the Stat method. StatFunc func(name string) (fs.FileInfo, error) // SubFunc mocks the Sub method. SubFunc func(dir string) (fs.FS, error) // contains filtered or unexported fields }
FSMock is a mock implementation of FS.
func TestSomethingThatUsesFS(t *testing.T) { // make and configure a mocked FS mockedFS := &FSMock{ GlobFunc: func(pattern string) ([]string, error) { panic("mock out the Glob method") }, OpenFunc: func(name string) (fs.File, error) { panic("mock out the Open method") }, ReadFileFunc: func(name string) ([]byte, error) { panic("mock out the ReadFile method") }, StatFunc: func(name string) (fs.FileInfo, error) { panic("mock out the Stat method") }, SubFunc: func(dir string) (fs.FS, error) { panic("mock out the Sub method") }, } // use mockedFS in code that requires FS // and then make assertions. }
func (*FSMock) GlobCalls ¶
GlobCalls gets all the calls that were made to Glob. Check the length with:
len(mockedFS.GlobCalls())
func (*FSMock) OpenCalls ¶
OpenCalls gets all the calls that were made to Open. Check the length with:
len(mockedFS.OpenCalls())
func (*FSMock) ReadFileCalls ¶
ReadFileCalls gets all the calls that were made to ReadFile. Check the length with:
len(mockedFS.ReadFileCalls())
type FileInfoMock ¶
type FileInfoMock struct { // IsDirFunc mocks the IsDir method. IsDirFunc func() bool // ModTimeFunc mocks the ModTime method. ModTimeFunc func() time.Time // ModeFunc mocks the Mode method. ModeFunc func() fs.FileMode // NameFunc mocks the Name method. NameFunc func() string // SizeFunc mocks the Size method. SizeFunc func() int64 // SysFunc mocks the Sys method. SysFunc func() any // contains filtered or unexported fields }
FileInfoMock is a mock implementation of FileInfo.
func TestSomethingThatUsesFileInfo(t *testing.T) { // make and configure a mocked FileInfo mockedFileInfo := &FileInfoMock{ IsDirFunc: func() bool { panic("mock out the IsDir method") }, ModTimeFunc: func() time.Time { panic("mock out the ModTime method") }, ModeFunc: func() fs.FileMode { panic("mock out the Mode method") }, NameFunc: func() string { panic("mock out the Name method") }, SizeFunc: func() int64 { panic("mock out the Size method") }, SysFunc: func() any { panic("mock out the Sys method") }, } // use mockedFileInfo in code that requires FileInfo // and then make assertions. }
func (*FileInfoMock) IsDirCalls ¶
func (mock *FileInfoMock) IsDirCalls() []struct { }
IsDirCalls gets all the calls that were made to IsDir. Check the length with:
len(mockedFileInfo.IsDirCalls())
func (*FileInfoMock) ModTime ¶
func (mock *FileInfoMock) ModTime() time.Time
ModTime calls ModTimeFunc.
func (*FileInfoMock) ModTimeCalls ¶
func (mock *FileInfoMock) ModTimeCalls() []struct { }
ModTimeCalls gets all the calls that were made to ModTime. Check the length with:
len(mockedFileInfo.ModTimeCalls())
func (*FileInfoMock) ModeCalls ¶
func (mock *FileInfoMock) ModeCalls() []struct { }
ModeCalls gets all the calls that were made to Mode. Check the length with:
len(mockedFileInfo.ModeCalls())
func (*FileInfoMock) NameCalls ¶
func (mock *FileInfoMock) NameCalls() []struct { }
NameCalls gets all the calls that were made to Name. Check the length with:
len(mockedFileInfo.NameCalls())
func (*FileInfoMock) SizeCalls ¶
func (mock *FileInfoMock) SizeCalls() []struct { }
SizeCalls gets all the calls that were made to Size. Check the length with:
len(mockedFileInfo.SizeCalls())
func (*FileInfoMock) SysCalls ¶
func (mock *FileInfoMock) SysCalls() []struct { }
SysCalls gets all the calls that were made to Sys. Check the length with:
len(mockedFileInfo.SysCalls())
type FileMock ¶
type FileMock struct { // CloseFunc mocks the Close method. CloseFunc func() error // ReadFunc mocks the Read method. ReadFunc func(bytes []byte) (int, error) // StatFunc mocks the Stat method. StatFunc func() (fs.FileInfo, error) // contains filtered or unexported fields }
FileMock is a mock implementation of File.
func TestSomethingThatUsesFile(t *testing.T) { // make and configure a mocked File mockedFile := &FileMock{ CloseFunc: func() error { panic("mock out the Close method") }, ReadFunc: func(bytes []byte) (int, error) { panic("mock out the Read method") }, StatFunc: func() (fs.FileInfo, error) { panic("mock out the Stat method") }, } // use mockedFile in code that requires File // and then make assertions. }
func (*FileMock) CloseCalls ¶
func (mock *FileMock) CloseCalls() []struct { }
CloseCalls gets all the calls that were made to Close. Check the length with:
len(mockedFile.CloseCalls())
type ManagerServiceMock ¶
type ManagerServiceMock struct { // CurrentListenersFunc mocks the CurrentListeners method. CurrentListenersFunc func(contextMoqParam context.Context) (eventstream.Stream[int64], error) // CurrentSongFunc mocks the CurrentSong method. CurrentSongFunc func(contextMoqParam context.Context) (eventstream.Stream[*radio.SongUpdate], error) // CurrentStatusFunc mocks the CurrentStatus method. CurrentStatusFunc func(contextMoqParam context.Context) (eventstream.Stream[radio.Status], error) // CurrentThreadFunc mocks the CurrentThread method. CurrentThreadFunc func(contextMoqParam context.Context) (eventstream.Stream[string], error) // CurrentUserFunc mocks the CurrentUser method. CurrentUserFunc func(contextMoqParam context.Context) (eventstream.Stream[*radio.User], error) // UpdateListenersFunc mocks the UpdateListeners method. UpdateListenersFunc func(contextMoqParam context.Context, n int64) error // UpdateSongFunc mocks the UpdateSong method. UpdateSongFunc func(contextMoqParam context.Context, songUpdate *radio.SongUpdate) error // UpdateThreadFunc mocks the UpdateThread method. UpdateThreadFunc func(contextMoqParam context.Context, s string) error // UpdateUserFunc mocks the UpdateUser method. UpdateUserFunc func(contextMoqParam context.Context, user *radio.User) error // contains filtered or unexported fields }
ManagerServiceMock is a mock implementation of radio.ManagerService.
func TestSomethingThatUsesManagerService(t *testing.T) { // make and configure a mocked radio.ManagerService mockedManagerService := &ManagerServiceMock{ CurrentListenersFunc: func(contextMoqParam context.Context) (eventstream.Stream[int64], error) { panic("mock out the CurrentListeners method") }, CurrentSongFunc: func(contextMoqParam context.Context) (eventstream.Stream[*radio.SongUpdate], error) { panic("mock out the CurrentSong method") }, CurrentStatusFunc: func(contextMoqParam context.Context) (eventstream.Stream[radio.Status], error) { panic("mock out the CurrentStatus method") }, CurrentThreadFunc: func(contextMoqParam context.Context) (eventstream.Stream[string], error) { panic("mock out the CurrentThread method") }, CurrentUserFunc: func(contextMoqParam context.Context) (eventstream.Stream[*radio.User], error) { panic("mock out the CurrentUser method") }, UpdateListenersFunc: func(contextMoqParam context.Context, n int64) error { panic("mock out the UpdateListeners method") }, UpdateSongFunc: func(contextMoqParam context.Context, songUpdate *radio.SongUpdate) error { panic("mock out the UpdateSong method") }, UpdateThreadFunc: func(contextMoqParam context.Context, s string) error { panic("mock out the UpdateThread method") }, UpdateUserFunc: func(contextMoqParam context.Context, user *radio.User) error { panic("mock out the UpdateUser method") }, } // use mockedManagerService in code that requires radio.ManagerService // and then make assertions. }
func (*ManagerServiceMock) CurrentListeners ¶
func (mock *ManagerServiceMock) CurrentListeners(contextMoqParam context.Context) (eventstream.Stream[int64], error)
CurrentListeners calls CurrentListenersFunc.
func (*ManagerServiceMock) CurrentListenersCalls ¶
func (mock *ManagerServiceMock) CurrentListenersCalls() []struct { ContextMoqParam context.Context }
CurrentListenersCalls gets all the calls that were made to CurrentListeners. Check the length with:
len(mockedManagerService.CurrentListenersCalls())
func (*ManagerServiceMock) CurrentSong ¶
func (mock *ManagerServiceMock) CurrentSong(contextMoqParam context.Context) (eventstream.Stream[*radio.SongUpdate], error)
CurrentSong calls CurrentSongFunc.
func (*ManagerServiceMock) CurrentSongCalls ¶
func (mock *ManagerServiceMock) CurrentSongCalls() []struct { ContextMoqParam context.Context }
CurrentSongCalls gets all the calls that were made to CurrentSong. Check the length with:
len(mockedManagerService.CurrentSongCalls())
func (*ManagerServiceMock) CurrentStatus ¶
func (mock *ManagerServiceMock) CurrentStatus(contextMoqParam context.Context) (eventstream.Stream[radio.Status], error)
CurrentStatus calls CurrentStatusFunc.
func (*ManagerServiceMock) CurrentStatusCalls ¶
func (mock *ManagerServiceMock) CurrentStatusCalls() []struct { ContextMoqParam context.Context }
CurrentStatusCalls gets all the calls that were made to CurrentStatus. Check the length with:
len(mockedManagerService.CurrentStatusCalls())
func (*ManagerServiceMock) CurrentThread ¶
func (mock *ManagerServiceMock) CurrentThread(contextMoqParam context.Context) (eventstream.Stream[string], error)
CurrentThread calls CurrentThreadFunc.
func (*ManagerServiceMock) CurrentThreadCalls ¶
func (mock *ManagerServiceMock) CurrentThreadCalls() []struct { ContextMoqParam context.Context }
CurrentThreadCalls gets all the calls that were made to CurrentThread. Check the length with:
len(mockedManagerService.CurrentThreadCalls())
func (*ManagerServiceMock) CurrentUser ¶
func (mock *ManagerServiceMock) CurrentUser(contextMoqParam context.Context) (eventstream.Stream[*radio.User], error)
CurrentUser calls CurrentUserFunc.
func (*ManagerServiceMock) CurrentUserCalls ¶
func (mock *ManagerServiceMock) CurrentUserCalls() []struct { ContextMoqParam context.Context }
CurrentUserCalls gets all the calls that were made to CurrentUser. Check the length with:
len(mockedManagerService.CurrentUserCalls())
func (*ManagerServiceMock) UpdateListeners ¶
func (mock *ManagerServiceMock) UpdateListeners(contextMoqParam context.Context, n int64) error
UpdateListeners calls UpdateListenersFunc.
func (*ManagerServiceMock) UpdateListenersCalls ¶
func (mock *ManagerServiceMock) UpdateListenersCalls() []struct { ContextMoqParam context.Context N int64 }
UpdateListenersCalls gets all the calls that were made to UpdateListeners. Check the length with:
len(mockedManagerService.UpdateListenersCalls())
func (*ManagerServiceMock) UpdateSong ¶
func (mock *ManagerServiceMock) UpdateSong(contextMoqParam context.Context, songUpdate *radio.SongUpdate) error
UpdateSong calls UpdateSongFunc.
func (*ManagerServiceMock) UpdateSongCalls ¶
func (mock *ManagerServiceMock) UpdateSongCalls() []struct { ContextMoqParam context.Context SongUpdate *radio.SongUpdate }
UpdateSongCalls gets all the calls that were made to UpdateSong. Check the length with:
len(mockedManagerService.UpdateSongCalls())
func (*ManagerServiceMock) UpdateThread ¶
func (mock *ManagerServiceMock) UpdateThread(contextMoqParam context.Context, s string) error
UpdateThread calls UpdateThreadFunc.
func (*ManagerServiceMock) UpdateThreadCalls ¶
func (mock *ManagerServiceMock) UpdateThreadCalls() []struct { ContextMoqParam context.Context S string }
UpdateThreadCalls gets all the calls that were made to UpdateThread. Check the length with:
len(mockedManagerService.UpdateThreadCalls())
func (*ManagerServiceMock) UpdateUser ¶
func (mock *ManagerServiceMock) UpdateUser(contextMoqParam context.Context, user *radio.User) error
UpdateUser calls UpdateUserFunc.
func (*ManagerServiceMock) UpdateUserCalls ¶
func (mock *ManagerServiceMock) UpdateUserCalls() []struct { ContextMoqParam context.Context User *radio.User }
UpdateUserCalls gets all the calls that were made to UpdateUser. Check the length with:
len(mockedManagerService.UpdateUserCalls())
type StorageServiceMock ¶
type StorageServiceMock struct { // NewsFunc mocks the News method. NewsFunc func(contextMoqParam context.Context) radio.NewsStorage // NewsTxFunc mocks the NewsTx method. NewsTxFunc func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.NewsStorage, radio.StorageTx, error) // QueueFunc mocks the Queue method. QueueFunc func(contextMoqParam context.Context) radio.QueueStorage // QueueTxFunc mocks the QueueTx method. QueueTxFunc func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.QueueStorage, radio.StorageTx, error) // RelayFunc mocks the Relay method. RelayFunc func(contextMoqParam context.Context) radio.RelayStorage // RelayTxFunc mocks the RelayTx method. RelayTxFunc func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.RelayStorage, radio.StorageTx, error) // RequestFunc mocks the Request method. RequestFunc func(contextMoqParam context.Context) radio.RequestStorage // RequestTxFunc mocks the RequestTx method. RequestTxFunc func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.RequestStorage, radio.StorageTx, error) // ScheduleFunc mocks the Schedule method. ScheduleFunc func(contextMoqParam context.Context) radio.ScheduleStorage // ScheduleTxFunc mocks the ScheduleTx method. ScheduleTxFunc func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.ScheduleStorage, radio.StorageTx, error) // SessionsFunc mocks the Sessions method. SessionsFunc func(contextMoqParam context.Context) radio.SessionStorage // SessionsTxFunc mocks the SessionsTx method. SessionsTxFunc func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.SessionStorage, radio.StorageTx, error) // SongFunc mocks the Song method. SongFunc func(contextMoqParam context.Context) radio.SongStorage // SongTxFunc mocks the SongTx method. SongTxFunc func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.SongStorage, radio.StorageTx, error) // StatusFunc mocks the Status method. StatusFunc func(contextMoqParam context.Context) radio.StatusStorage // SubmissionsFunc mocks the Submissions method. SubmissionsFunc func(contextMoqParam context.Context) radio.SubmissionStorage // SubmissionsTxFunc mocks the SubmissionsTx method. SubmissionsTxFunc func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.SubmissionStorage, radio.StorageTx, error) // TrackFunc mocks the Track method. TrackFunc func(contextMoqParam context.Context) radio.TrackStorage // TrackTxFunc mocks the TrackTx method. TrackTxFunc func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.TrackStorage, radio.StorageTx, error) // UserFunc mocks the User method. UserFunc func(contextMoqParam context.Context) radio.UserStorage // UserTxFunc mocks the UserTx method. UserTxFunc func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.UserStorage, radio.StorageTx, error) // contains filtered or unexported fields }
StorageServiceMock is a mock implementation of radio.StorageService.
func TestSomethingThatUsesStorageService(t *testing.T) { // make and configure a mocked radio.StorageService mockedStorageService := &StorageServiceMock{ NewsFunc: func(contextMoqParam context.Context) radio.NewsStorage { panic("mock out the News method") }, NewsTxFunc: func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.NewsStorage, radio.StorageTx, error) { panic("mock out the NewsTx method") }, QueueFunc: func(contextMoqParam context.Context) radio.QueueStorage { panic("mock out the Queue method") }, QueueTxFunc: func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.QueueStorage, radio.StorageTx, error) { panic("mock out the QueueTx method") }, RelayFunc: func(contextMoqParam context.Context) radio.RelayStorage { panic("mock out the Relay method") }, RelayTxFunc: func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.RelayStorage, radio.StorageTx, error) { panic("mock out the RelayTx method") }, RequestFunc: func(contextMoqParam context.Context) radio.RequestStorage { panic("mock out the Request method") }, RequestTxFunc: func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.RequestStorage, radio.StorageTx, error) { panic("mock out the RequestTx method") }, ScheduleFunc: func(contextMoqParam context.Context) radio.ScheduleStorage { panic("mock out the Schedule method") }, ScheduleTxFunc: func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.ScheduleStorage, radio.StorageTx, error) { panic("mock out the ScheduleTx method") }, SessionsFunc: func(contextMoqParam context.Context) radio.SessionStorage { panic("mock out the Sessions method") }, SessionsTxFunc: func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.SessionStorage, radio.StorageTx, error) { panic("mock out the SessionsTx method") }, SongFunc: func(contextMoqParam context.Context) radio.SongStorage { panic("mock out the Song method") }, SongTxFunc: func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.SongStorage, radio.StorageTx, error) { panic("mock out the SongTx method") }, StatusFunc: func(contextMoqParam context.Context) radio.StatusStorage { panic("mock out the Status method") }, SubmissionsFunc: func(contextMoqParam context.Context) radio.SubmissionStorage { panic("mock out the Submissions method") }, SubmissionsTxFunc: func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.SubmissionStorage, radio.StorageTx, error) { panic("mock out the SubmissionsTx method") }, TrackFunc: func(contextMoqParam context.Context) radio.TrackStorage { panic("mock out the Track method") }, TrackTxFunc: func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.TrackStorage, radio.StorageTx, error) { panic("mock out the TrackTx method") }, UserFunc: func(contextMoqParam context.Context) radio.UserStorage { panic("mock out the User method") }, UserTxFunc: func(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.UserStorage, radio.StorageTx, error) { panic("mock out the UserTx method") }, } // use mockedStorageService in code that requires radio.StorageService // and then make assertions. }
func (*StorageServiceMock) News ¶
func (mock *StorageServiceMock) News(contextMoqParam context.Context) radio.NewsStorage
News calls NewsFunc.
func (*StorageServiceMock) NewsCalls ¶
func (mock *StorageServiceMock) NewsCalls() []struct { ContextMoqParam context.Context }
NewsCalls gets all the calls that were made to News. Check the length with:
len(mockedStorageService.NewsCalls())
func (*StorageServiceMock) NewsTx ¶
func (mock *StorageServiceMock) NewsTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.NewsStorage, radio.StorageTx, error)
NewsTx calls NewsTxFunc.
func (*StorageServiceMock) NewsTxCalls ¶
func (mock *StorageServiceMock) NewsTxCalls() []struct { ContextMoqParam context.Context StorageTx radio.StorageTx }
NewsTxCalls gets all the calls that were made to NewsTx. Check the length with:
len(mockedStorageService.NewsTxCalls())
func (*StorageServiceMock) Queue ¶
func (mock *StorageServiceMock) Queue(contextMoqParam context.Context) radio.QueueStorage
Queue calls QueueFunc.
func (*StorageServiceMock) QueueCalls ¶
func (mock *StorageServiceMock) QueueCalls() []struct { ContextMoqParam context.Context }
QueueCalls gets all the calls that were made to Queue. Check the length with:
len(mockedStorageService.QueueCalls())
func (*StorageServiceMock) QueueTx ¶
func (mock *StorageServiceMock) QueueTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.QueueStorage, radio.StorageTx, error)
QueueTx calls QueueTxFunc.
func (*StorageServiceMock) QueueTxCalls ¶
func (mock *StorageServiceMock) QueueTxCalls() []struct { ContextMoqParam context.Context StorageTx radio.StorageTx }
QueueTxCalls gets all the calls that were made to QueueTx. Check the length with:
len(mockedStorageService.QueueTxCalls())
func (*StorageServiceMock) Relay ¶
func (mock *StorageServiceMock) Relay(contextMoqParam context.Context) radio.RelayStorage
Relay calls RelayFunc.
func (*StorageServiceMock) RelayCalls ¶
func (mock *StorageServiceMock) RelayCalls() []struct { ContextMoqParam context.Context }
RelayCalls gets all the calls that were made to Relay. Check the length with:
len(mockedStorageService.RelayCalls())
func (*StorageServiceMock) RelayTx ¶
func (mock *StorageServiceMock) RelayTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.RelayStorage, radio.StorageTx, error)
RelayTx calls RelayTxFunc.
func (*StorageServiceMock) RelayTxCalls ¶
func (mock *StorageServiceMock) RelayTxCalls() []struct { ContextMoqParam context.Context StorageTx radio.StorageTx }
RelayTxCalls gets all the calls that were made to RelayTx. Check the length with:
len(mockedStorageService.RelayTxCalls())
func (*StorageServiceMock) Request ¶
func (mock *StorageServiceMock) Request(contextMoqParam context.Context) radio.RequestStorage
Request calls RequestFunc.
func (*StorageServiceMock) RequestCalls ¶
func (mock *StorageServiceMock) RequestCalls() []struct { ContextMoqParam context.Context }
RequestCalls gets all the calls that were made to Request. Check the length with:
len(mockedStorageService.RequestCalls())
func (*StorageServiceMock) RequestTx ¶
func (mock *StorageServiceMock) RequestTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.RequestStorage, radio.StorageTx, error)
RequestTx calls RequestTxFunc.
func (*StorageServiceMock) RequestTxCalls ¶
func (mock *StorageServiceMock) RequestTxCalls() []struct { ContextMoqParam context.Context StorageTx radio.StorageTx }
RequestTxCalls gets all the calls that were made to RequestTx. Check the length with:
len(mockedStorageService.RequestTxCalls())
func (*StorageServiceMock) Schedule ¶
func (mock *StorageServiceMock) Schedule(contextMoqParam context.Context) radio.ScheduleStorage
Schedule calls ScheduleFunc.
func (*StorageServiceMock) ScheduleCalls ¶
func (mock *StorageServiceMock) ScheduleCalls() []struct { ContextMoqParam context.Context }
ScheduleCalls gets all the calls that were made to Schedule. Check the length with:
len(mockedStorageService.ScheduleCalls())
func (*StorageServiceMock) ScheduleTx ¶
func (mock *StorageServiceMock) ScheduleTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.ScheduleStorage, radio.StorageTx, error)
ScheduleTx calls ScheduleTxFunc.
func (*StorageServiceMock) ScheduleTxCalls ¶
func (mock *StorageServiceMock) ScheduleTxCalls() []struct { ContextMoqParam context.Context StorageTx radio.StorageTx }
ScheduleTxCalls gets all the calls that were made to ScheduleTx. Check the length with:
len(mockedStorageService.ScheduleTxCalls())
func (*StorageServiceMock) Sessions ¶
func (mock *StorageServiceMock) Sessions(contextMoqParam context.Context) radio.SessionStorage
Sessions calls SessionsFunc.
func (*StorageServiceMock) SessionsCalls ¶
func (mock *StorageServiceMock) SessionsCalls() []struct { ContextMoqParam context.Context }
SessionsCalls gets all the calls that were made to Sessions. Check the length with:
len(mockedStorageService.SessionsCalls())
func (*StorageServiceMock) SessionsTx ¶
func (mock *StorageServiceMock) SessionsTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.SessionStorage, radio.StorageTx, error)
SessionsTx calls SessionsTxFunc.
func (*StorageServiceMock) SessionsTxCalls ¶
func (mock *StorageServiceMock) SessionsTxCalls() []struct { ContextMoqParam context.Context StorageTx radio.StorageTx }
SessionsTxCalls gets all the calls that were made to SessionsTx. Check the length with:
len(mockedStorageService.SessionsTxCalls())
func (*StorageServiceMock) Song ¶
func (mock *StorageServiceMock) Song(contextMoqParam context.Context) radio.SongStorage
Song calls SongFunc.
func (*StorageServiceMock) SongCalls ¶
func (mock *StorageServiceMock) SongCalls() []struct { ContextMoqParam context.Context }
SongCalls gets all the calls that were made to Song. Check the length with:
len(mockedStorageService.SongCalls())
func (*StorageServiceMock) SongTx ¶
func (mock *StorageServiceMock) SongTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.SongStorage, radio.StorageTx, error)
SongTx calls SongTxFunc.
func (*StorageServiceMock) SongTxCalls ¶
func (mock *StorageServiceMock) SongTxCalls() []struct { ContextMoqParam context.Context StorageTx radio.StorageTx }
SongTxCalls gets all the calls that were made to SongTx. Check the length with:
len(mockedStorageService.SongTxCalls())
func (*StorageServiceMock) Status ¶
func (mock *StorageServiceMock) Status(contextMoqParam context.Context) radio.StatusStorage
Status calls StatusFunc.
func (*StorageServiceMock) StatusCalls ¶
func (mock *StorageServiceMock) StatusCalls() []struct { ContextMoqParam context.Context }
StatusCalls gets all the calls that were made to Status. Check the length with:
len(mockedStorageService.StatusCalls())
func (*StorageServiceMock) Submissions ¶
func (mock *StorageServiceMock) Submissions(contextMoqParam context.Context) radio.SubmissionStorage
Submissions calls SubmissionsFunc.
func (*StorageServiceMock) SubmissionsCalls ¶
func (mock *StorageServiceMock) SubmissionsCalls() []struct { ContextMoqParam context.Context }
SubmissionsCalls gets all the calls that were made to Submissions. Check the length with:
len(mockedStorageService.SubmissionsCalls())
func (*StorageServiceMock) SubmissionsTx ¶
func (mock *StorageServiceMock) SubmissionsTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.SubmissionStorage, radio.StorageTx, error)
SubmissionsTx calls SubmissionsTxFunc.
func (*StorageServiceMock) SubmissionsTxCalls ¶
func (mock *StorageServiceMock) SubmissionsTxCalls() []struct { ContextMoqParam context.Context StorageTx radio.StorageTx }
SubmissionsTxCalls gets all the calls that were made to SubmissionsTx. Check the length with:
len(mockedStorageService.SubmissionsTxCalls())
func (*StorageServiceMock) Track ¶
func (mock *StorageServiceMock) Track(contextMoqParam context.Context) radio.TrackStorage
Track calls TrackFunc.
func (*StorageServiceMock) TrackCalls ¶
func (mock *StorageServiceMock) TrackCalls() []struct { ContextMoqParam context.Context }
TrackCalls gets all the calls that were made to Track. Check the length with:
len(mockedStorageService.TrackCalls())
func (*StorageServiceMock) TrackTx ¶
func (mock *StorageServiceMock) TrackTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.TrackStorage, radio.StorageTx, error)
TrackTx calls TrackTxFunc.
func (*StorageServiceMock) TrackTxCalls ¶
func (mock *StorageServiceMock) TrackTxCalls() []struct { ContextMoqParam context.Context StorageTx radio.StorageTx }
TrackTxCalls gets all the calls that were made to TrackTx. Check the length with:
len(mockedStorageService.TrackTxCalls())
func (*StorageServiceMock) User ¶
func (mock *StorageServiceMock) User(contextMoqParam context.Context) radio.UserStorage
User calls UserFunc.
func (*StorageServiceMock) UserCalls ¶
func (mock *StorageServiceMock) UserCalls() []struct { ContextMoqParam context.Context }
UserCalls gets all the calls that were made to User. Check the length with:
len(mockedStorageService.UserCalls())
func (*StorageServiceMock) UserTx ¶
func (mock *StorageServiceMock) UserTx(contextMoqParam context.Context, storageTx radio.StorageTx) (radio.UserStorage, radio.StorageTx, error)
UserTx calls UserTxFunc.
func (*StorageServiceMock) UserTxCalls ¶
func (mock *StorageServiceMock) UserTxCalls() []struct { ContextMoqParam context.Context StorageTx radio.StorageTx }
UserTxCalls gets all the calls that were made to UserTx. Check the length with:
len(mockedStorageService.UserTxCalls())
type StorageTxMock ¶
type StorageTxMock struct { // CommitFunc mocks the Commit method. CommitFunc func() error // RollbackFunc mocks the Rollback method. RollbackFunc func() error // contains filtered or unexported fields }
StorageTxMock is a mock implementation of radio.StorageTx.
func TestSomethingThatUsesStorageTx(t *testing.T) { // make and configure a mocked radio.StorageTx mockedStorageTx := &StorageTxMock{ CommitFunc: func() error { panic("mock out the Commit method") }, RollbackFunc: func() error { panic("mock out the Rollback method") }, } // use mockedStorageTx in code that requires radio.StorageTx // and then make assertions. }
func (*StorageTxMock) CommitCalls ¶
func (mock *StorageTxMock) CommitCalls() []struct { }
CommitCalls gets all the calls that were made to Commit. Check the length with:
len(mockedStorageTx.CommitCalls())
func (*StorageTxMock) Rollback ¶
func (mock *StorageTxMock) Rollback() error
Rollback calls RollbackFunc.
func (*StorageTxMock) RollbackCalls ¶
func (mock *StorageTxMock) RollbackCalls() []struct { }
RollbackCalls gets all the calls that were made to Rollback. Check the length with:
len(mockedStorageTx.RollbackCalls())
type SubmissionStorageMock ¶
type SubmissionStorageMock struct { // AllFunc mocks the All method. AllFunc func() ([]radio.PendingSong, error) // GetSubmissionFunc mocks the GetSubmission method. GetSubmissionFunc func(submissionID radio.SubmissionID) (*radio.PendingSong, error) // InsertPostPendingFunc mocks the InsertPostPending method. InsertPostPendingFunc func(pendingSong radio.PendingSong) error // InsertSubmissionFunc mocks the InsertSubmission method. InsertSubmissionFunc func(pendingSong radio.PendingSong) error // LastSubmissionTimeFunc mocks the LastSubmissionTime method. LastSubmissionTimeFunc func(identifier string) (time.Time, error) // RemoveSubmissionFunc mocks the RemoveSubmission method. RemoveSubmissionFunc func(submissionID radio.SubmissionID) error // SubmissionStatsFunc mocks the SubmissionStats method. SubmissionStatsFunc func(identifier string) (radio.SubmissionStats, error) // UpdateSubmissionTimeFunc mocks the UpdateSubmissionTime method. UpdateSubmissionTimeFunc func(identifier string) error // contains filtered or unexported fields }
SubmissionStorageMock is a mock implementation of radio.SubmissionStorage.
func TestSomethingThatUsesSubmissionStorage(t *testing.T) { // make and configure a mocked radio.SubmissionStorage mockedSubmissionStorage := &SubmissionStorageMock{ AllFunc: func() ([]radio.PendingSong, error) { panic("mock out the All method") }, GetSubmissionFunc: func(submissionID radio.SubmissionID) (*radio.PendingSong, error) { panic("mock out the GetSubmission method") }, InsertPostPendingFunc: func(pendingSong radio.PendingSong) error { panic("mock out the InsertPostPending method") }, InsertSubmissionFunc: func(pendingSong radio.PendingSong) error { panic("mock out the InsertSubmission method") }, LastSubmissionTimeFunc: func(identifier string) (time.Time, error) { panic("mock out the LastSubmissionTime method") }, RemoveSubmissionFunc: func(submissionID radio.SubmissionID) error { panic("mock out the RemoveSubmission method") }, SubmissionStatsFunc: func(identifier string) (radio.SubmissionStats, error) { panic("mock out the SubmissionStats method") }, UpdateSubmissionTimeFunc: func(identifier string) error { panic("mock out the UpdateSubmissionTime method") }, } // use mockedSubmissionStorage in code that requires radio.SubmissionStorage // and then make assertions. }
func (*SubmissionStorageMock) All ¶
func (mock *SubmissionStorageMock) All() ([]radio.PendingSong, error)
All calls AllFunc.
func (*SubmissionStorageMock) AllCalls ¶
func (mock *SubmissionStorageMock) AllCalls() []struct { }
AllCalls gets all the calls that were made to All. Check the length with:
len(mockedSubmissionStorage.AllCalls())
func (*SubmissionStorageMock) GetSubmission ¶
func (mock *SubmissionStorageMock) GetSubmission(submissionID radio.SubmissionID) (*radio.PendingSong, error)
GetSubmission calls GetSubmissionFunc.
func (*SubmissionStorageMock) GetSubmissionCalls ¶
func (mock *SubmissionStorageMock) GetSubmissionCalls() []struct { SubmissionID radio.SubmissionID }
GetSubmissionCalls gets all the calls that were made to GetSubmission. Check the length with:
len(mockedSubmissionStorage.GetSubmissionCalls())
func (*SubmissionStorageMock) InsertPostPending ¶
func (mock *SubmissionStorageMock) InsertPostPending(pendingSong radio.PendingSong) error
InsertPostPending calls InsertPostPendingFunc.
func (*SubmissionStorageMock) InsertPostPendingCalls ¶
func (mock *SubmissionStorageMock) InsertPostPendingCalls() []struct { PendingSong radio.PendingSong }
InsertPostPendingCalls gets all the calls that were made to InsertPostPending. Check the length with:
len(mockedSubmissionStorage.InsertPostPendingCalls())
func (*SubmissionStorageMock) InsertSubmission ¶
func (mock *SubmissionStorageMock) InsertSubmission(pendingSong radio.PendingSong) error
InsertSubmission calls InsertSubmissionFunc.
func (*SubmissionStorageMock) InsertSubmissionCalls ¶
func (mock *SubmissionStorageMock) InsertSubmissionCalls() []struct { PendingSong radio.PendingSong }
InsertSubmissionCalls gets all the calls that were made to InsertSubmission. Check the length with:
len(mockedSubmissionStorage.InsertSubmissionCalls())
func (*SubmissionStorageMock) LastSubmissionTime ¶
func (mock *SubmissionStorageMock) LastSubmissionTime(identifier string) (time.Time, error)
LastSubmissionTime calls LastSubmissionTimeFunc.
func (*SubmissionStorageMock) LastSubmissionTimeCalls ¶
func (mock *SubmissionStorageMock) LastSubmissionTimeCalls() []struct { Identifier string }
LastSubmissionTimeCalls gets all the calls that were made to LastSubmissionTime. Check the length with:
len(mockedSubmissionStorage.LastSubmissionTimeCalls())
func (*SubmissionStorageMock) RemoveSubmission ¶
func (mock *SubmissionStorageMock) RemoveSubmission(submissionID radio.SubmissionID) error
RemoveSubmission calls RemoveSubmissionFunc.
func (*SubmissionStorageMock) RemoveSubmissionCalls ¶
func (mock *SubmissionStorageMock) RemoveSubmissionCalls() []struct { SubmissionID radio.SubmissionID }
RemoveSubmissionCalls gets all the calls that were made to RemoveSubmission. Check the length with:
len(mockedSubmissionStorage.RemoveSubmissionCalls())
func (*SubmissionStorageMock) SubmissionStats ¶
func (mock *SubmissionStorageMock) SubmissionStats(identifier string) (radio.SubmissionStats, error)
SubmissionStats calls SubmissionStatsFunc.
func (*SubmissionStorageMock) SubmissionStatsCalls ¶
func (mock *SubmissionStorageMock) SubmissionStatsCalls() []struct { Identifier string }
SubmissionStatsCalls gets all the calls that were made to SubmissionStats. Check the length with:
len(mockedSubmissionStorage.SubmissionStatsCalls())
func (*SubmissionStorageMock) UpdateSubmissionTime ¶
func (mock *SubmissionStorageMock) UpdateSubmissionTime(identifier string) error
UpdateSubmissionTime calls UpdateSubmissionTimeFunc.
func (*SubmissionStorageMock) UpdateSubmissionTimeCalls ¶
func (mock *SubmissionStorageMock) UpdateSubmissionTimeCalls() []struct { Identifier string }
UpdateSubmissionTimeCalls gets all the calls that were made to UpdateSubmissionTime. Check the length with:
len(mockedSubmissionStorage.UpdateSubmissionTimeCalls())
type TemplateSelectableMock ¶
type TemplateSelectableMock struct { // TemplateBundleFunc mocks the TemplateBundle method. TemplateBundleFunc func() string // TemplateNameFunc mocks the TemplateName method. TemplateNameFunc func() string // contains filtered or unexported fields }
TemplateSelectableMock is a mock implementation of templates.TemplateSelectable.
func TestSomethingThatUsesTemplateSelectable(t *testing.T) { // make and configure a mocked templates.TemplateSelectable mockedTemplateSelectable := &TemplateSelectableMock{ TemplateBundleFunc: func() string { panic("mock out the TemplateBundle method") }, TemplateNameFunc: func() string { panic("mock out the TemplateName method") }, } // use mockedTemplateSelectable in code that requires templates.TemplateSelectable // and then make assertions. }
func (*TemplateSelectableMock) TemplateBundle ¶
func (mock *TemplateSelectableMock) TemplateBundle() string
TemplateBundle calls TemplateBundleFunc.
func (*TemplateSelectableMock) TemplateBundleCalls ¶
func (mock *TemplateSelectableMock) TemplateBundleCalls() []struct { }
TemplateBundleCalls gets all the calls that were made to TemplateBundle. Check the length with:
len(mockedTemplateSelectable.TemplateBundleCalls())
func (*TemplateSelectableMock) TemplateName ¶
func (mock *TemplateSelectableMock) TemplateName() string
TemplateName calls TemplateNameFunc.
func (*TemplateSelectableMock) TemplateNameCalls ¶
func (mock *TemplateSelectableMock) TemplateNameCalls() []struct { }
TemplateNameCalls gets all the calls that were made to TemplateName. Check the length with:
len(mockedTemplateSelectable.TemplateNameCalls())
type TrackStorageMock ¶
type TrackStorageMock struct { // AllFunc mocks the All method. AllFunc func() ([]radio.Song, error) // BeforeLastRequestedFunc mocks the BeforeLastRequested method. BeforeLastRequestedFunc func(before time.Time) ([]radio.Song, error) // DecrementRequestCountFunc mocks the DecrementRequestCount method. DecrementRequestCountFunc func(before time.Time) error // DeleteFunc mocks the Delete method. DeleteFunc func(trackID radio.TrackID) error // GetFunc mocks the Get method. GetFunc func(trackID radio.TrackID) (*radio.Song, error) // InsertFunc mocks the Insert method. InsertFunc func(song radio.Song) (radio.TrackID, error) // QueueCandidatesFunc mocks the QueueCandidates method. QueueCandidatesFunc func() ([]radio.TrackID, error) // UnusableFunc mocks the Unusable method. UnusableFunc func() ([]radio.Song, error) // UpdateLastPlayedFunc mocks the UpdateLastPlayed method. UpdateLastPlayedFunc func(trackID radio.TrackID) error // UpdateLastRequestedFunc mocks the UpdateLastRequested method. UpdateLastRequestedFunc func(trackID radio.TrackID) error // UpdateMetadataFunc mocks the UpdateMetadata method. UpdateMetadataFunc func(song radio.Song) error // UpdateRequestInfoFunc mocks the UpdateRequestInfo method. UpdateRequestInfoFunc func(trackID radio.TrackID) error // UpdateUsableFunc mocks the UpdateUsable method. UpdateUsableFunc func(song radio.Song, state radio.TrackState) error // contains filtered or unexported fields }
TrackStorageMock is a mock implementation of radio.TrackStorage.
func TestSomethingThatUsesTrackStorage(t *testing.T) { // make and configure a mocked radio.TrackStorage mockedTrackStorage := &TrackStorageMock{ AllFunc: func() ([]radio.Song, error) { panic("mock out the All method") }, BeforeLastRequestedFunc: func(before time.Time) ([]radio.Song, error) { panic("mock out the BeforeLastRequested method") }, DecrementRequestCountFunc: func(before time.Time) error { panic("mock out the DecrementRequestCount method") }, DeleteFunc: func(trackID radio.TrackID) error { panic("mock out the Delete method") }, GetFunc: func(trackID radio.TrackID) (*radio.Song, error) { panic("mock out the Get method") }, InsertFunc: func(song radio.Song) (radio.TrackID, error) { panic("mock out the Insert method") }, QueueCandidatesFunc: func() ([]radio.TrackID, error) { panic("mock out the QueueCandidates method") }, UnusableFunc: func() ([]radio.Song, error) { panic("mock out the Unusable method") }, UpdateLastPlayedFunc: func(trackID radio.TrackID) error { panic("mock out the UpdateLastPlayed method") }, UpdateLastRequestedFunc: func(trackID radio.TrackID) error { panic("mock out the UpdateLastRequested method") }, UpdateMetadataFunc: func(song radio.Song) error { panic("mock out the UpdateMetadata method") }, UpdateRequestInfoFunc: func(trackID radio.TrackID) error { panic("mock out the UpdateRequestInfo method") }, UpdateUsableFunc: func(song radio.Song, state radio.TrackState) error { panic("mock out the UpdateUsable method") }, } // use mockedTrackStorage in code that requires radio.TrackStorage // and then make assertions. }
func (*TrackStorageMock) All ¶
func (mock *TrackStorageMock) All() ([]radio.Song, error)
All calls AllFunc.
func (*TrackStorageMock) AllCalls ¶
func (mock *TrackStorageMock) AllCalls() []struct { }
AllCalls gets all the calls that were made to All. Check the length with:
len(mockedTrackStorage.AllCalls())
func (*TrackStorageMock) BeforeLastRequested ¶
func (mock *TrackStorageMock) BeforeLastRequested(before time.Time) ([]radio.Song, error)
BeforeLastRequested calls BeforeLastRequestedFunc.
func (*TrackStorageMock) BeforeLastRequestedCalls ¶
func (mock *TrackStorageMock) BeforeLastRequestedCalls() []struct { Before time.Time }
BeforeLastRequestedCalls gets all the calls that were made to BeforeLastRequested. Check the length with:
len(mockedTrackStorage.BeforeLastRequestedCalls())
func (*TrackStorageMock) DecrementRequestCount ¶
func (mock *TrackStorageMock) DecrementRequestCount(before time.Time) error
DecrementRequestCount calls DecrementRequestCountFunc.
func (*TrackStorageMock) DecrementRequestCountCalls ¶
func (mock *TrackStorageMock) DecrementRequestCountCalls() []struct { Before time.Time }
DecrementRequestCountCalls gets all the calls that were made to DecrementRequestCount. Check the length with:
len(mockedTrackStorage.DecrementRequestCountCalls())
func (*TrackStorageMock) Delete ¶
func (mock *TrackStorageMock) Delete(trackID radio.TrackID) error
Delete calls DeleteFunc.
func (*TrackStorageMock) DeleteCalls ¶
func (mock *TrackStorageMock) DeleteCalls() []struct { TrackID radio.TrackID }
DeleteCalls gets all the calls that were made to Delete. Check the length with:
len(mockedTrackStorage.DeleteCalls())
func (*TrackStorageMock) Get ¶
func (mock *TrackStorageMock) Get(trackID radio.TrackID) (*radio.Song, error)
Get calls GetFunc.
func (*TrackStorageMock) GetCalls ¶
func (mock *TrackStorageMock) GetCalls() []struct { TrackID radio.TrackID }
GetCalls gets all the calls that were made to Get. Check the length with:
len(mockedTrackStorage.GetCalls())
func (*TrackStorageMock) Insert ¶
func (mock *TrackStorageMock) Insert(song radio.Song) (radio.TrackID, error)
Insert calls InsertFunc.
func (*TrackStorageMock) InsertCalls ¶
func (mock *TrackStorageMock) InsertCalls() []struct { Song radio.Song }
InsertCalls gets all the calls that were made to Insert. Check the length with:
len(mockedTrackStorage.InsertCalls())
func (*TrackStorageMock) QueueCandidates ¶
func (mock *TrackStorageMock) QueueCandidates() ([]radio.TrackID, error)
QueueCandidates calls QueueCandidatesFunc.
func (*TrackStorageMock) QueueCandidatesCalls ¶
func (mock *TrackStorageMock) QueueCandidatesCalls() []struct { }
QueueCandidatesCalls gets all the calls that were made to QueueCandidates. Check the length with:
len(mockedTrackStorage.QueueCandidatesCalls())
func (*TrackStorageMock) Unusable ¶
func (mock *TrackStorageMock) Unusable() ([]radio.Song, error)
Unusable calls UnusableFunc.
func (*TrackStorageMock) UnusableCalls ¶
func (mock *TrackStorageMock) UnusableCalls() []struct { }
UnusableCalls gets all the calls that were made to Unusable. Check the length with:
len(mockedTrackStorage.UnusableCalls())
func (*TrackStorageMock) UpdateLastPlayed ¶
func (mock *TrackStorageMock) UpdateLastPlayed(trackID radio.TrackID) error
UpdateLastPlayed calls UpdateLastPlayedFunc.
func (*TrackStorageMock) UpdateLastPlayedCalls ¶
func (mock *TrackStorageMock) UpdateLastPlayedCalls() []struct { TrackID radio.TrackID }
UpdateLastPlayedCalls gets all the calls that were made to UpdateLastPlayed. Check the length with:
len(mockedTrackStorage.UpdateLastPlayedCalls())
func (*TrackStorageMock) UpdateLastRequested ¶
func (mock *TrackStorageMock) UpdateLastRequested(trackID radio.TrackID) error
UpdateLastRequested calls UpdateLastRequestedFunc.
func (*TrackStorageMock) UpdateLastRequestedCalls ¶
func (mock *TrackStorageMock) UpdateLastRequestedCalls() []struct { TrackID radio.TrackID }
UpdateLastRequestedCalls gets all the calls that were made to UpdateLastRequested. Check the length with:
len(mockedTrackStorage.UpdateLastRequestedCalls())
func (*TrackStorageMock) UpdateMetadata ¶
func (mock *TrackStorageMock) UpdateMetadata(song radio.Song) error
UpdateMetadata calls UpdateMetadataFunc.
func (*TrackStorageMock) UpdateMetadataCalls ¶
func (mock *TrackStorageMock) UpdateMetadataCalls() []struct { Song radio.Song }
UpdateMetadataCalls gets all the calls that were made to UpdateMetadata. Check the length with:
len(mockedTrackStorage.UpdateMetadataCalls())
func (*TrackStorageMock) UpdateRequestInfo ¶
func (mock *TrackStorageMock) UpdateRequestInfo(trackID radio.TrackID) error
UpdateRequestInfo calls UpdateRequestInfoFunc.
func (*TrackStorageMock) UpdateRequestInfoCalls ¶
func (mock *TrackStorageMock) UpdateRequestInfoCalls() []struct { TrackID radio.TrackID }
UpdateRequestInfoCalls gets all the calls that were made to UpdateRequestInfo. Check the length with:
len(mockedTrackStorage.UpdateRequestInfoCalls())
func (*TrackStorageMock) UpdateUsable ¶
func (mock *TrackStorageMock) UpdateUsable(song radio.Song, state radio.TrackState) error
UpdateUsable calls UpdateUsableFunc.
func (*TrackStorageMock) UpdateUsableCalls ¶
func (mock *TrackStorageMock) UpdateUsableCalls() []struct { Song radio.Song State radio.TrackState }
UpdateUsableCalls gets all the calls that were made to UpdateUsable. Check the length with:
len(mockedTrackStorage.UpdateUsableCalls())
type UserStorageMock ¶
type UserStorageMock struct { // AllFunc mocks the All method. AllFunc func() ([]radio.User, error) // ByNickFunc mocks the ByNick method. ByNickFunc func(nick string) (*radio.User, error) // GetFunc mocks the Get method. GetFunc func(name string) (*radio.User, error) // GetByDJIDFunc mocks the GetByDJID method. GetByDJIDFunc func(dJID radio.DJID) (*radio.User, error) // LookupNameFunc mocks the LookupName method. LookupNameFunc func(name string) (*radio.User, error) // PermissionsFunc mocks the Permissions method. PermissionsFunc func() ([]radio.UserPermission, error) // RecordListenersFunc mocks the RecordListeners method. RecordListenersFunc func(n int64, user radio.User) error // UpdateUserFunc mocks the UpdateUser method. UpdateUserFunc func(user radio.User) (radio.User, error) // contains filtered or unexported fields }
UserStorageMock is a mock implementation of radio.UserStorage.
func TestSomethingThatUsesUserStorage(t *testing.T) { // make and configure a mocked radio.UserStorage mockedUserStorage := &UserStorageMock{ AllFunc: func() ([]radio.User, error) { panic("mock out the All method") }, ByNickFunc: func(nick string) (*radio.User, error) { panic("mock out the ByNick method") }, GetFunc: func(name string) (*radio.User, error) { panic("mock out the Get method") }, GetByDJIDFunc: func(dJID radio.DJID) (*radio.User, error) { panic("mock out the GetByDJID method") }, LookupNameFunc: func(name string) (*radio.User, error) { panic("mock out the LookupName method") }, PermissionsFunc: func() ([]radio.UserPermission, error) { panic("mock out the Permissions method") }, RecordListenersFunc: func(n int64, user radio.User) error { panic("mock out the RecordListeners method") }, UpdateUserFunc: func(user radio.User) (radio.User, error) { panic("mock out the UpdateUser method") }, } // use mockedUserStorage in code that requires radio.UserStorage // and then make assertions. }
func (*UserStorageMock) All ¶
func (mock *UserStorageMock) All() ([]radio.User, error)
All calls AllFunc.
func (*UserStorageMock) AllCalls ¶
func (mock *UserStorageMock) AllCalls() []struct { }
AllCalls gets all the calls that were made to All. Check the length with:
len(mockedUserStorage.AllCalls())
func (*UserStorageMock) ByNick ¶
func (mock *UserStorageMock) ByNick(nick string) (*radio.User, error)
ByNick calls ByNickFunc.
func (*UserStorageMock) ByNickCalls ¶
func (mock *UserStorageMock) ByNickCalls() []struct { Nick string }
ByNickCalls gets all the calls that were made to ByNick. Check the length with:
len(mockedUserStorage.ByNickCalls())
func (*UserStorageMock) Get ¶
func (mock *UserStorageMock) Get(name string) (*radio.User, error)
Get calls GetFunc.
func (*UserStorageMock) GetByDJID ¶
func (mock *UserStorageMock) GetByDJID(dJID radio.DJID) (*radio.User, error)
GetByDJID calls GetByDJIDFunc.
func (*UserStorageMock) GetByDJIDCalls ¶
func (mock *UserStorageMock) GetByDJIDCalls() []struct { DJID radio.DJID }
GetByDJIDCalls gets all the calls that were made to GetByDJID. Check the length with:
len(mockedUserStorage.GetByDJIDCalls())
func (*UserStorageMock) GetCalls ¶
func (mock *UserStorageMock) GetCalls() []struct { Name string }
GetCalls gets all the calls that were made to Get. Check the length with:
len(mockedUserStorage.GetCalls())
func (*UserStorageMock) LookupName ¶
func (mock *UserStorageMock) LookupName(name string) (*radio.User, error)
LookupName calls LookupNameFunc.
func (*UserStorageMock) LookupNameCalls ¶
func (mock *UserStorageMock) LookupNameCalls() []struct { Name string }
LookupNameCalls gets all the calls that were made to LookupName. Check the length with:
len(mockedUserStorage.LookupNameCalls())
func (*UserStorageMock) Permissions ¶
func (mock *UserStorageMock) Permissions() ([]radio.UserPermission, error)
Permissions calls PermissionsFunc.
func (*UserStorageMock) PermissionsCalls ¶
func (mock *UserStorageMock) PermissionsCalls() []struct { }
PermissionsCalls gets all the calls that were made to Permissions. Check the length with:
len(mockedUserStorage.PermissionsCalls())
func (*UserStorageMock) RecordListeners ¶
func (mock *UserStorageMock) RecordListeners(n int64, user radio.User) error
RecordListeners calls RecordListenersFunc.
func (*UserStorageMock) RecordListenersCalls ¶
func (mock *UserStorageMock) RecordListenersCalls() []struct { N int64 User radio.User }
RecordListenersCalls gets all the calls that were made to RecordListeners. Check the length with:
len(mockedUserStorage.RecordListenersCalls())
func (*UserStorageMock) UpdateUser ¶
func (mock *UserStorageMock) UpdateUser(user radio.User) (radio.User, error)
UpdateUser calls UpdateUserFunc.
func (*UserStorageMock) UpdateUserCalls ¶
func (mock *UserStorageMock) UpdateUserCalls() []struct { User radio.User }
UpdateUserCalls gets all the calls that were made to UpdateUser. Check the length with:
len(mockedUserStorage.UpdateUserCalls())