コード例 #1
0
        /// <summary>
        /// Asserts that the <paramref name="serviceComment"/> contains equivalent values from the <paramref name="comment"/>.
        /// </summary>
        /// <param name="comment">The comment with expected values.</param>
        /// <param name="serviceComment">The comment with actual values.</param>
        private static void AssertComment(RCE.Infrastructure.Models.Comment comment, Comment serviceComment)
        {
            Assert.AreEqual(comment.ProviderUri, serviceComment.Id);
            Assert.AreEqual(comment.Creator, serviceComment.Creator);
            Assert.AreEqual(comment.Created, serviceComment.Created);
            Assert.AreEqual(comment.MarkIn, serviceComment.MarkIn);
            Assert.AreEqual(comment.MarkOut, serviceComment.MarkOut);
            Assert.AreEqual(comment.CommentType.ToString(), serviceComment.Type);
            Assert.AreEqual(comment.Text, serviceComment.Text);

            InkComment inkComment = serviceComment as InkComment;

            if (inkComment != null)
            {
                StringAssert.Contains(inkComment.Strokes, "#00000000");
                StringAssert.Contains(inkComment.Strokes, "#01020304");
            }
        }
コード例 #2
0
        /// <summary>
        /// Asserts that the <paramref name="comment"/> contains equivalent values from the <paramref name="serviceComment"/>.
        /// </summary>
        /// <param name="serviceComment">The comment with expected values.</param>
        /// <param name="comment">The comment with actual values.</param>
        private static void AssertComment(Comment serviceComment, RCE.Infrastructure.Models.Comment comment)
        {
            Assert.AreEqual(serviceComment.Id, comment.ProviderUri);
            Assert.AreEqual(serviceComment.Creator, comment.Creator);
            Assert.AreEqual(serviceComment.Created, comment.Created);
            Assert.AreEqual(serviceComment.MarkIn, comment.MarkIn);
            Assert.AreEqual(serviceComment.MarkOut, comment.MarkOut);
            Assert.AreEqual(serviceComment.Type, comment.CommentType.ToString());

            if (serviceComment.Type == CommentType.Ink.ToString())
            {
                Assert.AreEqual(serviceComment.Text, comment.Text);
                Assert.AreEqual(1, ((Infrastructure.Models.InkComment)comment).InkCommentStrokes.Count());
            }
            else
            {
                Assert.AreEqual(serviceComment.Text, comment.Text);
            }
        }