示例#1
0
        /// <summary>
        /// Adds a reply link to this commententry
        ///    -> this new entry will reply to the passed in entry when the comment is 
        ///    submitted. This will not protect from adding the same guy several times.
        /// </summary>
        /// <param name="theOriginalComment"></param>
        /// <returns></returns>
        public void ReplyTo(CommentEntry theOriginalComment) {
            if (theOriginalComment.SelfUri == null) {
                throw new ArgumentException("You can only reply to an entry with a valid SelfUri");
            }

            AtomLink link = new AtomLink(AtomLink.ATOM_TYPE, YouTubeNameTable.ReplyToRelationship);
            link.HRef = theOriginalComment.SelfUri;
            this.Links.Add(link);
        }
示例#2
0
        public void CommentEntryReplyToTest()
        {
            CommentEntry target = new CommentEntry();
            Assert.AreEqual(target.Replies.Count, 0," list should be emptyl"); 
            CommentEntry other = new CommentEntry();
            other.SelfUri = new AtomUri("http://www.test.org");
            target.ReplyTo(other);
            Assert.AreEqual(target.Replies.Count, 1," list should be emptyl"); 


        }
示例#3
0
        /// <summary>
        /// Adds a reply link to this commententry
        ///    -> this new entry will reply to the passed in entry when the comment is
        ///    submitted. This will not protect from adding the same guy several times.
        /// </summary>
        /// <param name="theOriginalComment"></param>
        /// <returns></returns>
        public void  ReplyTo(CommentEntry theOriginalComment)
        {
            if (theOriginalComment.SelfUri == null)
            {
                throw new ArgumentException("You can only reply to an entry with a valid SelfUri");
            }
            AtomLink link = new AtomLink(AtomLink.ATOM_TYPE, YouTubeNameTable.ReplyToRelationship);

            link.HRef = theOriginalComment.SelfUri;
            this.Links.Add(link);
        }
示例#4
0
 public void CommentEntryConstructorTest()
 {
     CommentEntry target = new CommentEntry();
     Assert.IsNotNull(target,"object should not be null"); 
 }