public void AcceptsValidInput(string input) { var tagParser = new TagParser(); var modParser = new ModificationParser(tagParser); Assert.NotNull(modParser.Parse(input)); }
public void GetsCorrectOperation(string input, Operations operation) { var tagParser = new TagParser(); var modParser = new ModificationParser(tagParser); Assert.Equal(operation, modParser.Parse(input).Operation); }
public void ThrowsExceptionInvalidInput(string input) { var tagParser = new TagParser(); var modParser = new ModificationParser(tagParser); Assert.Throws <ParsingException>(() => modParser.Parse(input)); }
public void ParseTest() { var detector = new SingleAndMultiLineModifiedBlockDetector("修正行", "▼", "▲"); var reader = new TextFileReaderImpl(); var parser = new ModificationParser(detector); var m = parser.Parse(reader.Read("modification.cpp")); Assert.IsTrue(m.RangeList.Count == 4); Assert.IsTrue(m.RangeList.Any(x => x.Begin == 6 & x.End == 8)); Assert.IsTrue(m.RangeList.Any(x => x.Begin == 11 & x.End == 41)); Assert.IsTrue(m.RangeList.Any(x => x.Begin == 51 & x.End == 51)); Assert.IsTrue(m.RangeList.Any(x => x.Begin == 54 & x.End == 54)); }