Ejemplo n.º 1
0
        public static void MHorizontalRule_Constructor_AssignStyle()
        {
            HorizontalRuleStyle style = HorizontalRuleStyle();

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

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

            Style     = style;
            Count     = count;
            Separator = separator;
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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 + " "));
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 7
0
 public MHorizontalRule(HorizontalRuleStyle style, int count, string separator)
 {
     Style     = style;
     Count     = count;
     Separator = separator;
 }
Ejemplo n.º 8
0
 public HorizontalRuleFormat(HorizontalRuleStyle style, int count, string separator);
Ejemplo n.º 9
0
 public abstract void WriteHorizontalRule(HorizontalRuleStyle style, int count = 3, string separator = " ");