Commit 07641f3e authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Add missing test file

parent df059e91
#include "Tests.h"
#include "IAlbum.h"
#include "IAlbumTrack.h"
#include "IArtist.h"
class AlbumTracks : public Tests
{
};
TEST_F( AlbumTracks, Artists )
{
auto album = ml->createAlbum( "album" );
auto artist1 = ml->createArtist( "artist 1" );
auto artist2 = ml->createArtist( "artist 2" );
album->addTrack( "track 1", 1 );
album->addTrack( "track 2", 2 );
album->addTrack( "track 3", 3 );
ASSERT_NE( artist1, nullptr );
ASSERT_NE( artist2, nullptr );
auto tracks = album->tracks();
for ( auto& t : tracks )
{
t->addArtist( artist1 );
t->addArtist( artist2 );
auto artists = t->artists();
ASSERT_EQ( artists.size(), 2u );
}
auto artists = ml->artists();
for ( auto& a : artists )
{
auto tracks = a->tracks();
ASSERT_EQ( tracks.size(), 3u );
}
Reload();
album = ml->album( "album" );
tracks = album->tracks();
for ( auto& t : tracks )
{
auto artists = t->artists();
ASSERT_EQ( artists.size(), 2u );
}
artists = ml->artists();
for ( auto& a : artists )
{
auto tracks = a->tracks();
ASSERT_EQ( tracks.size(), 3u );
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment