mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-29 18:49:51 +01:00
c043eaba0c
Add lots of test infrastructure.
32 lines
537 B
C++
32 lines
537 B
C++
#include "song.h"
|
|
#include <lastfm/Track>
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
#include "test_utils.h"
|
|
|
|
namespace {
|
|
|
|
class SongTest : public ::testing::Test {
|
|
|
|
};
|
|
|
|
|
|
TEST_F(SongTest, InitsFromLastFM) {
|
|
Song song;
|
|
lastfm::MutableTrack track;
|
|
track.setTitle("Foo");
|
|
lastfm::Artist artist("Bar");
|
|
track.setArtist(artist);
|
|
lastfm::Album album(artist, "Baz");
|
|
track.setAlbum(album);
|
|
|
|
song.InitFromLastFM(track);
|
|
EXPECT_EQ("Foo", song.title());
|
|
EXPECT_EQ("Baz", song.album());
|
|
EXPECT_EQ("Bar", song.artist());
|
|
}
|
|
|
|
|
|
} // namespace
|