public void TestNegativeBlockComments(string content) { var input = new TextInputRange { File = new TextFile { Content = content, Filename = "" } }; var exception = Assert.Throws <Exception>(() => CommentScanner.Scan(input)); Assert.True(exception.Message.Equals(value: "Line Comment not Escaped.")); }
public void TestNegativeLineComments(string content) { var input = new TextInputRange { File = new TextFile { Content = content, Filename = "" } }; var output = CommentScanner.Scan(input); Assert.IsFalse(output); Assert.AreEqual(content[index: 0], input.EndChar); }
public void TestPositiveLineComments(string content) { var input = new TextInputRange { File = new TextFile { Content = content, Filename = "" } }; var output = CommentScanner.Scan(input); Assert.IsTrue(output); Assert.IsFalse(input.IsEndValid); }
public void TestPositiveBlockComments(string content, int line) { var input = new TextInputRange { File = new TextFile { Content = content, Filename = "" } }; var output = CommentScanner.Scan(input); Assert.IsTrue(output); Assert.IsFalse(input.IsEndValid); Assert.AreEqual(line, input.End.Line); }
public void TestNegativeLineEndLineComments(string content) { var input = new TextInputRange { File = new TextFile { Content = content, Filename = "" } }; var output = CommentScanner.Scan(input); Assert.IsTrue(output); Assert.IsTrue(input.IsEndValid); Assert.AreEqual(expected: '\n', actual: input.EndChar); }