Пример #1
0
        public void Test_VelocityCharStream()
        {
            String s1 = "this is a test";
            VelocityCharStream vcs = new VelocityCharStream(new StringReader(s1), 1, 1);

            String s2 = String.Empty;
            try {
            Char c = vcs.readChar();
            while (true) {
            s2 += c;
            c = vcs.readChar();
            }
            } catch (System.IO.IOException) {
            // this is expected to happen when the stream has been read
            }
            Assertion.Assert("read stream did not match source string", s1.Equals(s2));
        }