Example #1
0
        public async Task DeletePost_Success()
        {
            tumblrClient = new TumblrClientFactory().Create <TumblrClient>(_consumerKey, _consumerSecret, new Token(_accessKey, _accessSecret));

            await tumblrClient.DeletePostAsync("newtsharp.tumblr.com", DeletePostInfo.PostId);

            DeletePostInfo = null;
        }
Example #2
0
        public async Task CreatePost_Required_2()
        {
            tumblrClient = new TumblrClientFactory().Create <TumblrClient>(_consumerKey, _consumerSecret, null);

            PostData postData = PostData.CreateText(_postText + _footnote, "Testpost", new List <string> {
                "NewTumblrSharp", "Test"
            });

            PostCreationInfo postCreationInfo = await tumblrClient.CreatePostAsync("newtsharp.tumblr.com", postData);
        }
Example #3
0
        public async Task CreatePost_Text_1()
        {
            tumblrClient = new TumblrClientFactory().Create <TumblrClient>(_consumerKey, _consumerSecret, new Token(_accessKey, _accessSecret));

            PostData postData = PostData.CreateText(_postText + _footnote, "Testpost", new List <string> {
                "NewTumblrSharp", _version
            });

            PostCreationInfo postCreationInfo = await tumblrClient.CreatePostAsync("newtsharp.tumblr.com", postData);

            Assert.IsNotNull(postCreationInfo);

            Assert.AreNotEqual(postCreationInfo.PostId, 0);
        }
        /// <inheritdoc />
        public (PostEntity IndexEntity, PostContentEntity ContentEntity) CreatePostEntities(
            int authorId, PostCreationInfo creationInfoModel)
        {
            if (creationInfoModel == null)
            {
                throw new ArgumentNullException(nameof(creationInfoModel));
            }

            var contentEntity = PostContentEntity.Create();

            contentEntity.Text = creationInfoModel.Text;

            var indexEntity = PostEntity.Create(authorId, creationInfoModel.RegionId, creationInfoModel.Title,
                                                contentEntity.Id.ToByteArray());

            return(indexEntity, contentEntity);
        }
Example #5
0
        public async Task CreatePost_Required_4()
        {
            tumblrClient = new TumblrClientFactory().Create <TumblrClient>(_consumerKey, _consumerSecret, new Token(_accessKey, _accessSecret));

            PostCreationInfo postCreationInfo = await tumblrClient.CreatePostAsync("newtsharp.tumblr.com", PostData.CreateText());
        }