예제 #1
0
        internal static MarkdownList ToMDList(DotNetCommentList commentList, DotNetMember parent = null)
        {
            MarkdownList markdownList = new MarkdownList(isNumbered: commentList.IsNumbered);

            foreach (DotNetCommentListItem commentItem in commentList.Items)
            {
                MarkdownLine text = new MarkdownLine();
                if (commentItem.Term == null && commentItem.Description == null)
                {
                    markdownList.Add(text);
                    continue;
                }

                if (commentItem.Term == null)
                {
                    text = DotNetCommentGroupToMarkdownLine(commentItem.Description, parent);
                }
                else if (commentItem.Description == null)
                {
                    text = DotNetCommentGroupToMarkdownLine(commentItem.Term, parent);
                }
                else
                {
                    text = DotNetCommentGroupToMarkdownLine(commentItem.Term, parent);
                    text.Add(": ");
                    text.Concat(DotNetCommentGroupToMarkdownLine(commentItem.Description, parent));
                }
                markdownList.Add(text);
            }

            return(markdownList);
        }
예제 #2
0
        internal static MarkdownList EnumToMinimalMDList(DotNetType _enum)
        {
            MarkdownList list = new MarkdownList(isNumbered: false);

            foreach (DotNetField field in _enum.Fields)
            {
                list.Add(new MarkdownLine(field.ConstantValue + ": " + field.Name.LocalName));
            }

            return(list);
        }
예제 #3
0
        public bool AddMarkdown(string sku, double amount)
        {
            if (ValidateSkuEntry(sku, amount))
            {
                MarkdownList.Add(sku, amount);

                return(MarkdownList.Any(markdown => markdown.Key.Equals(sku) && markdown.Value.Equals(amount)));
            }

            return(false);
        }
예제 #4
0
        public void MarkdownList_Add_InLine()
        {
            //arrange
            MarkdownList list = new MarkdownList();
            MarkdownText text = new MarkdownText("abc");

            //act
            list.Add(text as IMarkdownInLine);
            //assert
            Assert.AreEqual(1, list.Length);
            Assert.IsNotNull(list[0]);
        }