public void publish_photo_to_application_album()
        {
            #if DEBUG
            string photoPath = @"..\..\..\Funtown.Tests\bin\Debug\monkey.jpg";
            #else
            string photoPath = @"..\..\..\Funtown.Tests\bin\Release\monkey.jpg";
            #endif

            byte[] photo = File.ReadAllBytes(photoPath);
            FuntownClient app = new FuntownClient();
            dynamic parameters = new ExpandoObject();
            parameters.access_token = ConfigurationManager.AppSettings["AccessToken"];
            parameters.caption = "This is a test photo of a monkey that has been uploaded " +
                                 "by the Funtown C# SDK (http://funtownsdk.codeplex.com)" +
                                 "using the REST API";
            parameters.method = "funtown.photos.upload";
            parameters.uid = ConfigurationManager.AppSettings["UserId"];
            var mediaObject = new FuntownMediaObject
            {
                FileName = "monkey.jpg",
                ContentType = "image/jpeg",
            };
            mediaObject.SetValue(photo);
            parameters.source = mediaObject;
            dynamic result = app.Post(parameters);

            Assert.NotNull(result);
            Assert.NotEqual(result.aid, null);
        }
        public void Publish_Photo_To_Existing_Album()
        {
            #if DEBUG
            string photoPath = @"..\..\..\Funtown.Tests\bin\Debug\monkey.jpg";
            #else
            string photoPath = @"..\..\..\Funtown.Tests\bin\Release\monkey.jpg";
            #endif
            string albumId = ConfigurationManager.AppSettings["AlbumId"];
            byte[] photo = File.ReadAllBytes(photoPath);

            FuntownClient app = new FuntownClient();
            dynamic parameters = new ExpandoObject();
            parameters.access_token = ConfigurationManager.AppSettings["AccessToken"];
            parameters.message = "This is a test photo of a monkey that has been uploaded " +
                                 "by the Funtown C# SDK (http://funtownsdk.codeplex.com)" +
                                 "using the Graph API";
            var mediaObject = new FuntownMediaObject
            {
                FileName = "monkey.jpg",
                ContentType = "image/jpeg",
            };
            mediaObject.SetValue(photo);
            parameters.source = mediaObject;

            dynamic result = app.Post(String.Format("/{0}/photos", albumId), parameters);

            Assert.NotNull(result);
            Assert.NotEqual(null, result.id);
        }
        public void Publish_Video_To_Wall()
        {
            var videoPath = TestHelpers.GetPathRelativeToExecutable("do-beer-not-drugs.3gp");
            byte[] video = File.ReadAllBytes(videoPath);

            var mediaObject = new FuntownMediaObject
                                  {
                                      FileName = "do-beer-not-drugs.3gp",
                                      ContentType = "video/3gpp"
                                  };
            mediaObject.SetValue(video);

            dynamic parameters = new ExpandoObject();
            parameters.source = mediaObject;
            parameters.method = "video.upload";
            parameters.access_token = ConfigurationManager.AppSettings["AccessToken"];

            var fb = new FuntownClient();
            dynamic result = fb.Post(parameters);

            Assert.NotNull(result);
            Assert.NotEqual(null, result.vid);
        }