public void CreateMethodComment()
        {
            var method = new MockMethod();
            var instance = new DefaultEnglishCommentCreator();
            method.Description = "A Test description";

            CodeCommentStatementCollection result = instance.CreateMethodComment(method);
            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count);
            Assert.IsNotNull(result[0].Comment);
            Assert.AreEqual("<summary>A Test description</summary>", result[0].Comment.Text);

            method.Description = "A <nasty> \"description\"";
            result = instance.CreateMethodComment(method);
            Assert.AreEqual("<summary>A &lt;nasty&gt; &quot;description&quot;</summary>", result[0].Comment.Text);
        }
Пример #2
0
        public void CreateMethodComment()
        {
            var method   = new MockMethod();
            var instance = new DefaultEnglishCommentCreator();

            method.Description = "A Test description";

            CodeCommentStatementCollection result = instance.CreateMethodComment(method);

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count);
            Assert.IsNotNull(result[0].Comment);
            Assert.AreEqual("<summary>A Test description</summary>", result[0].Comment.Text);

            method.Description = "A <nasty> \"description\"";
            result             = instance.CreateMethodComment(method);
            Assert.AreEqual("<summary>A &lt;nasty&gt; &quot;description&quot;</summary>", result[0].Comment.Text);
        }
Пример #3
0
        public void CreateMethodCommentValidateParams()
        {
            var instance = new DefaultEnglishCommentCreator();

            Assert.Throws(typeof(ArgumentNullException), () => instance.CreateMethodComment(null));
        }
 public void CreateMethodCommentValidateParams()
 {
     var instance = new DefaultEnglishCommentCreator();
     Assert.Throws(typeof(ArgumentNullException), () => instance.CreateMethodComment(null));
 }