Ejemplo n.º 1
0
        public void ReadColumnsAddColumnsTest()
        {
            const char separator = CharsSplitReader.Comma;
            var        expecteds = new string[] { "A", "B", "C", "D", "", };
            var        text      = string.Join(separator.ToString(), expecteds);
            var        raw       = Encoding.UTF8.GetBytes(text);
            var        actuals   = new CharsColumns();

            using (var readerStream = new MemoryStream(raw))
                using (var reader = new CharsSplitReader(readerStream))
                {
                    Assert.IsTrue(reader.ReadColumnsLength(separator, actuals), "!ReadColumns");
                    Assert.AreEqual(expecteds.Length, actuals.Count, "expecteds.Length != actuals.Count");
                    var actualsColumns = actuals.ToStringsArray();
                    for (var i = expecteds.Length - 1; i >= 0; --i)
                    {
                        Assert.AreEqual(expecteds[i], actualsColumns[i], i.ToString());
                    }
                }
        }
Ejemplo n.º 2
0
 public static void Clear(CharsColumns value)
 {
     value.Clear();
 }