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 (IOException)
{
// this is expected to happen when the stream has been read
}
Assert.IsTrue(s1.Equals(s2), "read stream did not match source string");
}