grafana/pkg/services/playlist/playlisttest/fake.go
Sofia Papagiannaki fb379ae436
Chore: Introduce playlist service (#52252)
* Store: Introduce playlist service

* Integrate playlist service

* Update swagger
2022-07-18 05:26:35 -04:00

44 lines
1.4 KiB
Go

package playlisttest
import (
"context"
"github.com/grafana/grafana/pkg/services/playlist"
)
type FakePlaylistService struct {
ExpectedPlaylist *playlist.Playlist
ExpectedPlaylistDTO *playlist.PlaylistDTO
ExpectedPlaylistItems []playlist.PlaylistItem
ExpectedPlaylists playlist.Playlists
ExpectedError error
}
func NewPlaylistServiveFake() *FakePlaylistService {
return &FakePlaylistService{}
}
func (f *FakePlaylistService) Create(context.Context, *playlist.CreatePlaylistCommand) (*playlist.Playlist, error) {
return f.ExpectedPlaylist, f.ExpectedError
}
func (f *FakePlaylistService) Update(context.Context, *playlist.UpdatePlaylistCommand) (*playlist.PlaylistDTO, error) {
return f.ExpectedPlaylistDTO, f.ExpectedError
}
func (f *FakePlaylistService) Get(context.Context, *playlist.GetPlaylistByUidQuery) (*playlist.Playlist, error) {
return f.ExpectedPlaylist, f.ExpectedError
}
func (f *FakePlaylistService) GetItems(context.Context, *playlist.GetPlaylistItemsByUidQuery) ([]playlist.PlaylistItem, error) {
return f.ExpectedPlaylistItems, f.ExpectedError
}
func (f *FakePlaylistService) Search(context.Context, *playlist.GetPlaylistsQuery) (playlist.Playlists, error) {
return f.ExpectedPlaylists, f.ExpectedError
}
func (f *FakePlaylistService) Delete(ctx context.Context, cmd *playlist.DeletePlaylistCommand) error {
return f.ExpectedError
}