[libgfbgraph] GTest: A test for the creation of an Album



commit b6a67cc54cf886b26d79207ed2cb61e339dcfe8b
Author: Álvaro Peña <alvaropg gmail com>
Date:   Tue Apr 15 20:48:36 2014 +0200

    GTest: A test for the creation of an Album

 tests/gtestutils.c |   29 +++++++++++++++++++++++++++++
 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) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]