ReadChar() публичный Метод

public ReadChar ( ) : bool
Результат bool
Пример #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 (IOException)
			{
				// this is expected to happen when the stream has been read
			}
			Assert.IsTrue(s1.Equals(s2), "read stream did not match source string");
		}
Пример #2
0
		public void Test_VelocityTryCharStream()
		{
			String s1 = "this is a test";
			VelocityCharStream vcs = new VelocityCharStream(new StringReader(s1), 1, 1);

			String s2 = String.Empty;

			while(vcs.ReadChar())
			{
				s2 += vcs.CurrentCharacter;
			}
			Assert.IsTrue(s1.Equals(s2), "read stream did not match source string");
		}