public void ParseError(ErrorCase <int> @case) { int pos = @case.Start; Assert.Throws <FormatException>(() => IntReader.ReadInt32(@case.Text, ref pos)); Assert.AreEqual(pos, @case.ExpectedEnd); }
public void ParseError(ErrorData <int> data) { int pos = data.Start; Assert.Throws <FormatException>(() => IntReader.ReadInt32(data.Text, ref pos)); Assert.AreEqual(pos, data.ExpectedEnd); }
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); }