Commit b75e9ac5 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

Album: Add a fetch from DB unit test

parent 78ebbafe
......@@ -11,6 +11,7 @@ class IAlbum
{
public:
virtual ~IAlbum() {}
virtual unsigned int id() const = 0;
virtual const std::string& name() = 0;
virtual unsigned int releaseYear() = 0;
virtual const std::string& shortSummary() = 0;
......
#include "gtest/gtest.h"
#include "IMediaLibrary.h"
#include "IFile.h"
#include "IAlbum.h"
class Albums : public testing::Test
{
......@@ -35,3 +35,17 @@ TEST_F( Albums, Create )
ASSERT_EQ( a, a2 );
}
TEST_F( Albums, Fetch )
{
auto a = ml->createAlbum( "album" );
// Clear the cache
delete ml;
SetUp();
auto a2 = ml->album( "album" );
// The shared pointer are expected to point to a different instance
ASSERT_NE( a, a2 );
ASSERT_EQ( a->id(), a2->id() );
}
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