Esempio n. 1
0
        public void ParseError(ErrorCase <int> @case)
        {
            int pos = @case.Start;

            Assert.Throws <FormatException>(() => IntReader.ReadInt32(@case.Text, ref pos));
            Assert.AreEqual(pos, @case.ExpectedEnd);
        }
Esempio n. 2
0
        public void ParseError(ErrorData <int> data)
        {
            int pos = data.Start;

            Assert.Throws <FormatException>(() => IntReader.ReadInt32(data.Text, ref pos));
            Assert.AreEqual(pos, data.ExpectedEnd);
        }
Esempio n. 3
0
        public void ParseSuccess(SuccessCase <int> data)
        {
            int pos    = data.Start;
            var actual = IntReader.ReadInt32(data.Text, ref pos);

            Assert.AreEqual(actual, data.Expected);
            Assert.AreEqual(pos, data.ExpectedEnd);
        }