Example #1
0
        public void MultiLineFormatter_Guarantees_One_Space()
        {
            //If delimiter is null, guarantee a space between messages.
            Assert.True(
                MultiLineFormatter.ToMultiLine(delimiter: null,
                                               messages: new List <string>()
            {
                "test1", "test2", "test3"
            }
                                               ) == "test1 test2 test3");

            //However, if there's already a space or multiple spaces, don't interfere with that. We just
            //want to guarantee that there's at least one space.
            Assert.True(
                MultiLineFormatter.ToMultiLine(delimiter: null,
                                               messages: new List <string>()
            {
                "test1", "test2 ", " test3"
            }
                                               ) == "test1 test2  test3");


            Assert.True(
                MultiLineFormatter.ToMultiLine(delimiter: null,
                                               messages: new List <string>()
            {
                " test1", "test2 ", "test3"
            }
                                               ) == " test1 test2 test3");
        }
 public void MultiLineFormatter_Delimits_Properly()
 {
     //Normal case
     Assert.IsTrue(
         MultiLineFormatter.ToMultiLine(delimiter: "<br>",
                                        messages: new List <string>()
     {
         "test1", "test2", "test3"
     }
                                        ) == "test1<br>test2<br>test3<br>");
 }
Example #3
0
 /// <summary>
 /// Dumps the message list into a string, with a delimiter after each line. If no delimiter is specified, Outcome will make sure there is
 /// a space after each message.
 /// </summary>
 /// <param name="delimiter">A delimiter that goes after each string in the message list. Useful for implementing platform-appropriate line breaks.</param>
 /// <returns>The message list, concatenated.</returns>
 public string ToMultiLine(string delimiter = null)
 {
     return(MultiLineFormatter.ToMultiLine(delimiter, Messages));
 }