public void AddOnlyImage()
 {
     Photo response;
                 Photo test_photo = new Photo ("testimg.jpg");
                 response = photos.Add (test_photo);
                 Assert.AreNotEqual (response, null);
 }
 public void AddWithDisabledComments()
 {
     Photo response;
                 Photo test_photo = new Photo ("testimg.jpg");
                 test_photo.DisableComments = true;
                 response = photos.Add (test_photo);
                 Assert.AreNotEqual (response, null);
 }
 public void AddWithAdultContent()
 {
     Photo response;
                 Photo test_photo = new Photo ("testimg.jpg");
                 test_photo.AdultContent = true;
                 response = photos.Add (test_photo);
                 Assert.AreNotEqual (response, null);
 }
 public void AddForMyself()
 {
     Photo response;
                 Photo test_photo = new Photo ("testimg.jpg");
                 test_photo.AccessLevel = Access.Private;
                 response = photos.Add (test_photo);
                 Assert.AreNotEqual (response, null);
 }
 public void AddForFriends()
 {
     Photo response;
                 Photo test_photo = new Photo ("testimg.jpg");
                 test_photo.AccessLevel = Access.Friends;
                 response = photos.Add (test_photo);
                 Assert.AreNotEqual (response, null);
 }
        internal void Add(Photo photo)
        {
            lock (photos_to_upload) {
                                photos_to_upload.Enqueue (photo);
                        }

                        if (upload_thread == null || !upload_thread.IsAlive) {
                                upload_thread = new Thread (UploadPhotosFromQueue);
                                upload_thread.Start ();
                        }
        }
 public void AddWithAllProperties()
 {
     Photo response;
                 Photo test_photo = new Photo ("testimg.jpg");
                 test_photo.Title = "Рябина под крышей";
                 test_photo.AccessLevel = Access.Private;
                 test_photo.AdultContent = true;
                 test_photo.HideOriginal = true;
                 test_photo.DisableComments = true;
                 response = photos.Add (test_photo);
                 Assert.AreNotEqual (response, null);
 }
 internal static MultipartData BuildMultipartData(Photo photo)
 {
     MultipartData data = new MultipartData ();
                 data.Add (new MultipartData.Parameter ("image", photo.Filepath,
                                         MultipartData.Parameter.ParamType.File));
                 data.Add (new MultipartData.Parameter ("title", photo.Title,
                                         MultipartData.Parameter.ParamType.Field));
                 data.Add (new MultipartData.Parameter ("access_type", Photo.ToString (photo.AccessLevel),
                                         MultipartData.Parameter.ParamType.Field));
                 data.Add (new MultipartData.Parameter ("disable_comments",
                                         photo.DisableComments.ToString ().ToLower (),
                                         MultipartData.Parameter.ParamType.Field));
                 data.Add (new MultipartData.Parameter ("hide_orignal",
                                         photo.HideOriginal.ToString ().ToLower (),
                                         MultipartData.Parameter.ParamType.Field));
                 data.Add (new MultipartData.Parameter ("xxx",
                                         photo.AdultContent.ToString ().ToLower (),
                                         MultipartData.Parameter.ParamType.Field));
                 return data;
 }
 public void AddWithTitle()
 {
     Photo response;
                 Photo test_photo = new Photo ("testimg.jpg");
                 test_photo.Title = "Рябина под крышей";
                 response = photos.Add (test_photo);
                 Assert.AreNotEqual (response, null);
 }
Ejemplo n.º 10
0
 public void AddWithHiddenOriginal()
 {
     Photo response;
                 Photo test_photo = new Photo ("testimg.jpg");
                 test_photo.HideOriginal = true;
                 response = photos.Add (test_photo);
                 Assert.AreNotEqual (response, null);
 }
Ejemplo n.º 11
0
 public void UpdateTitle()
 {
     Photo test_photo = new Photo ("testimg.jpg");
                 test_photo = photos.Add (test_photo);
                 test_photo.Title = "Изменённое название";
                 test_photo.Update ();
 }
 public UploadPhotoCompletedEventArgs(Photo photo)
 {
     UploadedPhoto = photo;
 }