public void DontRemoveBlankLines() { string text = "Four score and\n\nseven years ago our fathers"; string expected = "Four score and" + Environment.NewLine + Environment.NewLine + "seven years ago our fathers"; string actual = Reformat.Text(text); Assert.AreEqual(expected, actual); }
public void RemoveWhiteSpace() { string text = " Four score and\n\t \tseven years ago our fathers"; string expected = "Four score and seven years ago our fathers"; string actual = Reformat.Text(text); Assert.AreEqual(expected, actual); }
public void RemoveNewLines() { string text = "Four score and\nseven years\rago our\r\nfathers"; string expected = "Four score and seven years ago our fathers"; string actual = Reformat.Text(text); Assert.AreEqual(expected, actual); }
public void BlankLine() { string text = " Four score and\n \nseven years\n\n ago"; string expected = "Four score and\n \nseven years\n \n ago\n"; string actual = Reformat.Code(text); Assert.AreEqual(expected, actual); }
public void ReplaceTabs() { string text = "Four score and\tseven years\tago"; string expected = "Four score and seven years ago\n"; string actual = Reformat.Code(text); Assert.AreEqual(expected, actual); }
public void DontRemovePadding() { string text = " Four score and\n seven years\n ago"; string expected = "Four score and\n seven years\n ago\n"; string actual = Reformat.Code(text); Assert.AreEqual(expected, actual); text = "Four score and\n seven years\n\tago our"; expected = "Four score and\n seven years\n ago our\n"; actual = Reformat.Code(text); Assert.AreEqual(expected, actual); }
static void Main(string[] args) { var inputFile = args[0]; bool crush = false; if (args.Length > 1) { if (args[1].ToLower() == "-crush") { crush = bool.Parse(args[2]); } } Reformat.DoReformating(inputFile, crush); }