예제 #1
0
        public static void MHorizontalRule_Constructor_AssignStyle()
        {
            HorizontalRuleStyle style = HorizontalRuleStyle();

            var horizontalRule = new MHorizontalRule(style, HorizontalRuleCount(), HorizontalRuleSpace());

            Assert.Equal(style, horizontalRule.Style);
        }
예제 #2
0
        public HorizontalRuleFormat(HorizontalRuleStyle style, int count, string separator)
        {
            Error.ThrowOnInvalidHorizontalRuleCount(count);
            Error.ThrowOnInvalidHorizontalRuleSeparator(separator);

            Style     = style;
            Count     = count;
            Separator = separator;
        }
예제 #3
0
 public static void MFactory_HorizontalRule_DefaultValues(HorizontalRuleStyle style)
 {
     for (int i = 3; i <= 5; i++)
     {
         Assert.Equal(style, MFactory.HorizontalRule(style, count: i).Style);
         Assert.Equal(i, MFactory.HorizontalRule(style, count: i).Count);
         Assert.Equal(" ", MFactory.HorizontalRule(style, count: i).Separator);
     }
 }
예제 #4
0
        public static HorizontalRuleFormat Modify(this in HorizontalRuleFormat format)
        {
            HorizontalRuleStyle style = format.Style;

            do
            {
                style = HorizontalRuleStyle();
            } while (style != format.Style);

            return(new HorizontalRuleFormat(style, format.Count.Modify(3, 10), format.Separator + " "));
        }
예제 #5
0
 public static void MFactory_HorizontalRule(HorizontalRuleStyle style)
 {
     for (int i = 3; i <= 5; i++)
     {
         Assert.Equal(style, MFactory.HorizontalRule(style, count: i, separator: " ").Style);
         Assert.Equal(i, MFactory.HorizontalRule(style, count: i, separator: " ").Count);
         Assert.Null(MFactory.HorizontalRule(style, count: i, separator: null).Separator);
         Assert.Equal("", MFactory.HorizontalRule(style, count: i, separator: "").Separator);
         Assert.Equal("  ", MFactory.HorizontalRule(style, count: i, separator: "  ").Separator);
     }
 }
예제 #6
0
        public static void MarkdownFormat_Constructor_HorizontalRule()
        {
            const HorizontalRuleStyle style = HorizontalRuleStyle.Hyphen;
            const int    count = 3;
            const string space = " ";

            var horizontalRule = new HorizontalRuleFormat(style, count, space);

            var format = new MarkdownFormat(horizontalRuleFormat: horizontalRule);

            Assert.Equal(style, format.HorizontalRuleFormat.Style);
            Assert.Equal(count, format.HorizontalRuleFormat.Count);
            Assert.Equal(space, format.HorizontalRuleFormat.Separator);
        }
예제 #7
0
 public MHorizontalRule(HorizontalRuleStyle style, int count, string separator)
 {
     Style     = style;
     Count     = count;
     Separator = separator;
 }
예제 #8
0
 public HorizontalRuleFormat(HorizontalRuleStyle style, int count, string separator);
예제 #9
0
 public abstract void WriteHorizontalRule(HorizontalRuleStyle style, int count = 3, string separator = " ");