public void TestCommentEliminatorMixedNewlines() { var testContent = "A B\nC D // comment\nA B\r\nC D // comment\r\n/* block comment\r\nsecond line\r\n */ "; CommentEliminator p = new CommentEliminator(testContent); var result = p.Process(); var expected = "A B\nC D \nA B\nC D \n\n\n "; Assert.AreEqual(expected, result); }
public void TestCommentEliminator() { var testContent = @"A// C A /* C */ A A * A * /* * C *// A/* C C C */"; CommentEliminator p = new CommentEliminator(testContent); var result = p.Process(); var expected = "A\nA A\n\nA * A * / A\n\n\n"; Assert.AreEqual(expected.Replace("\r", ""), result.Replace("\r", "")); //Windows perculiarity }