Exemple #1
0
        public void width()
        {
            var set = new ColumnSet(3);
            var line = set.Add("aaaaa", "bbb", "cc");

            // the default padding between columns is 5 spaces
            line.Width.ShouldEqual(20);
        }
Exemple #2
0
 public void adding_a_line_with_the_wrong_counts_throws_exception()
 {
     Exception<ArgumentOutOfRangeException>.ShouldBeThrownBy(() =>
     {
         var set = new ColumnSet(3);
         set.Add("a", "b");
     });
 }
Exemple #3
0
        public void create_set_by_count()
        {
            var set = new ColumnSet(3);

            set.Columns.ShouldHaveTheSameElementsAs(
                new Column(ColumnJustification.left, 0, 5),
                new Column(ColumnJustification.left, 0, 5),
                new Column(ColumnJustification.left, 0, 0)
                );
        }
Exemple #4
0
        public void write_a_line()
        {
            var set = new ColumnSet(3);
            var line = set.Add("a", "b", "c");

            var writer = new StringWriter();

            line.Write(writer);

            var text = "a*****b*****c\r\n".Replace("*", " ");

            writer.ToString().ShouldEqualWithLineEndings(text);
        }