Example #1
0
 public void TryTextFixedWriter06()
 {
     using (var sw = new StringWriter())
     {
         using (var w = new TextFixedWriter(sw, new TextFixedSettings()
         {
             Lengths = new int[] { 5, 5 }
         }))
         {
             w.WriteRow(new string[] { "zu", "viele", "Rows" });
         }
         Assert.AreEqual("zu   viele\r\n", sw.ToString());
     }
 }
Example #2
0
 public void TryTextFixedWriter05()
 {
     using (var sw = new StringWriter())
     {
         using (var w = new TextFixedWriter(sw, new TextFixedSettings()
         {
             Lengths = new int[] { 12, 5 }
         }))
         {
             w.WriteRow(new string[] { "zuwenig Rows" });
         }
         Assert.AreEqual("zuwenig Rows     \r\n", sw.ToString());
     }
 }
Example #3
0
 public void TryTextFixedWriter04()
 {
     using (var sw = new StringWriter())
     {
         using (var w = new TextFixedWriter(sw, new TextFixedSettings()
         {
             Lengths = new int[] { 5, 5 }
         }))
         {
             w.WriteRow(new string[] { "Wert1", "Wert2" });
         }
         Assert.AreEqual("Wert1Wert2\r\n", sw.ToString());
     }
 }
Example #4
0
 public void TryTextFixedWriter03()
 {
     using (var sw = new StringWriter())
     {
         using (var w = new TextFixedWriter(sw, new TextFixedSettings()
         {
             Lengths = new int[] { 12 }
         }))
         {
             w.WriteRow(new string[] { "genaue Länge" });
         }
         Assert.AreEqual("genaue Länge\r\n", sw.ToString());
     }
 }
Example #5
0
 public void TryTextFixedWriter02()
 {
     using (var sw = new StringWriter())
     {
         using (var w = new TextFixedWriter(sw, new TextFixedSettings()
         {
             Lengths = new int[] { 8 }
         }))
         {
             w.WriteRow(new string[] { "Der Text ist zu lang" });
         }
         Assert.AreEqual("Der Text\r\n", sw.ToString());
     }
 }
Example #6
0
 public void TryTextFixedWriter07()
 {
     // HeaderRow > StartRow
     using (var sw = new StringWriter())
     {
         using (var w = new TextFixedWriter(sw, new TextFixedSettings()
         {
             Lengths = new int[] { 5 }, HeaderRow = 2, StartRow = 1
         }))
         {
             w.WriteRow(new string[] { "hi" });
         }
         Assert.AreEqual("hi   \r\n", sw.ToString());
     }
 }