summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÁlvaro Peña <alvaropg@gmail.com>2014-04-15 20:48:36 +0200
committerÁlvaro Peña <alvaropg@gmail.com>2014-04-15 20:48:36 +0200
commitb6a67cc54cf886b26d79207ed2cb61e339dcfe8b (patch)
tree98425dfd8e0d298f459ae878727551b3e7595fae
parentf77583f48b3fc907e8fd5c1ff793386197607432 (diff)
downloadlibgfbgraph-b6a67cc54cf886b26d79207ed2cb61e339dcfe8b.tar.gz
GTest: A test for the creation of an Album
-rw-r--r--tests/gtestutils.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/gtestutils.c b/tests/gtestutils.c
index 5c81104..59cf87a 100644
--- a/tests/gtestutils.c
+++ b/tests/gtestutils.c
@@ -205,6 +205,28 @@ gfbgraph_test_me (GFBGraphTestFixture *fixture, gconstpointer user_data)
g_object_unref (me);
}
+static void
+gfbgraph_test_album (GFBGraphTestFixture *fixture, gconstpointer user_data)
+{
+ GFBGraphUser *me;
+ GFBGraphAlbum *album;
+ GError *error = NULL;
+
+ me = gfbgraph_user_get_me (GFBGRAPH_AUTHORIZER (fixture->authorizer), &error);
+ g_assert_no_error (error);
+ g_assert (GFBGRAPH_IS_USER (me));
+
+ /* Create a photo album */
+ album = gfbgraph_album_new ();
+ gfbgraph_album_set_name (album, "Vanilla Sky");
+ gfbgraph_album_set_description (album, "Great sunset photos in Mars!");
+ g_assert (gfbgraph_node_append_connection (GFBGRAPH_NODE (me),
+ GFBGRAPH_NODE (album),
+ GFBGRAPH_AUTHORIZER (fixture->authorizer),
+ &error));
+ g_assert_no_error (error);
+}
+
int
main (int argc, char **argv)
{
@@ -222,6 +244,13 @@ main (int argc, char **argv)
gfbgraph_test_me,
gfbgraph_test_fixture_teardown);
+ g_test_add ("/GFBGraph/Album",
+ GFBGraphTestFixture,
+ app,
+ gfbgraph_test_fixture_setup,
+ gfbgraph_test_album,
+ gfbgraph_test_fixture_teardown);
+
test_result = g_test_run ();
if (app) {