Example #1
0
 public void TestLongListItemsAreAutomaticallyWrappedAt80CharactersByDefault()
 {
     var list = new NumberedList(
         "Every body persists in its state of being at rest or of moving uniformly straight forward, except insofar as it is compelled to change its state by force impressed.",
         "The change of momentum of a body is proportional to the impulse impressed on the body, and happens along the straight line on which that impulse is impressed.",
         "To every action there is always opposed an equal reaction: or the mutual actions of two bodies upon each other are always equal, and directed to contrary parts.");
     list.WriteToTrace();
 }
Example #2
0
 public void TestWordWrapColumnCanBeSpecified()
 {
     var list = new NumberedList(
         "A straight line segment can be drawn joining any two points.",
         "Any straight line segment can be extended indefinitely in a straight line.",
         "Given any straight line segment, a circle can be drawn having the segment as radius and one endpoint as center.",
         "All right angles are congruent.",
         "If two lines are drawn which intersect a third in such a way that the sum of the inner angles on one side is less than two right angles, then the two lines inevitably must intersect each other on that side if extended far enough. This postulate is equivalent to what is known as the parallel postulate.")
     {
         WordWrapColumn = 40
     };
     list.WriteToTrace();
 }
Example #3
0
        public void TestListsCanBeNumbered()
        {
            var list = new NumberedList(
                "The Beatles",
                "Elvis Presley",
                "Michael Jackson",
                "Madonna",
                "Elton John");

            list.AssertOutputEquals(
                "   1. The Beatles\r\n" +
                "   2. Elvis Presley\r\n" +
                "   3. Michael Jackson\r\n" +
                "   4. Madonna\r\n" +
                "   5. Elton John\r\n"
                ,
                "<ol>\n" +
                "<li>The Beatles</li>\n" +
                "<li>Elvis Presley</li>\n" +
                "<li>Michael Jackson</li>\n" +
                "<li>Madonna</li>\n" +
                "<li>Elton John</li>\n" +
                "</ol>\n");
        }