示例#1
0
        public async Task PublishPostWithOnlinePictureAsync()
        {
            var post = new PhotoCreatingRequest
            {
                Caption = Guid.NewGuid().ToString("N"),
                Url     = TestsBase.OnlinePicture
            };

            var response = await post.PublishAsync(TestsBase.PageId, TestsBase.PageAccessToken);

            Assert.IsTrue(response.Code == ResponseCode.SUCCESS, response.ReasonPhrase ?? String.Empty);

            var jobj = JObject.Parse(response.Data);

            Assert.IsTrue(jobj["id"] != null && !String.IsNullOrEmpty(jobj["id"].ToString()));
        }
示例#2
0
        public async Task SchedulePostWithOnlinePictureAsync()
        {
            var post = new PhotoCreatingRequest
            {
                Caption   = Guid.NewGuid().ToString("N"),
                Url       = TestsBase.OnlinePicture,
                Published = false,
                UnpublishedContentType = UnpublishedContentType.Scheduled,
                ScheduledPublishTime   = DateTimeUtil.CountTimeStamp(DateTime.Now.AddHours(1))
            };

            var response = await post.PublishAsync(TestsBase.PageId, TestsBase.PageAccessToken);

            Assert.IsTrue(response.Code == ResponseCode.SUCCESS, response.ReasonPhrase ?? String.Empty);

            var jobj = JObject.Parse(response.Data);

            Assert.IsTrue(jobj["id"] != null && !String.IsNullOrEmpty(jobj["id"].ToString()));
        }