public void ProduceReport() { string testString = "This is simples! This will be fun!"; string expected = "Word | Number of Words | Prime?\nWill | 1 | False\nIs | 1 | False\nThis | 2 | True\nSimples | 1 | False\nBe | 1 | False\nFun | 1 | False"; Assert.AreEqual(expected, BookParser.ProduceReport(testString)); }
public void SplitBook() { string book = BookParser.LoadBook("../../../../text.txt"); var split = BookParser.SplitBook(book); Assert.AreEqual("The", split.GetValue(0)); }
public void Occurences() { string book = BookParser.LoadBook("../../../../text.txt"); var split = BookParser.SplitBook(book); var occurences = BookParser.Occurences(split); Assert.AreEqual(3437, occurences["The"]); }
public void LoadBook() { Assert.IsNotEmpty(BookParser.LoadBook("../../../../text.txt")); }
public void PrimeNumberNineEightFour() { Assert.IsFalse(BookParser.PrimeNumber(984)); }
public void PrimeNumberNineEightThree() { Assert.IsTrue(BookParser.PrimeNumber(983)); }
public void PrimeNumberFour() { Assert.IsFalse(BookParser.PrimeNumber(4)); }
public void PrimeNumberThree() { Assert.IsTrue(BookParser.PrimeNumber(3)); }
public void PrimeNumberTwo() { Assert.IsTrue(BookParser.PrimeNumber(2)); }
public void PrimeNumberOne() { Assert.IsFalse(BookParser.PrimeNumber(1)); }
public static void Main() { var text = LoadBook("../../../../text.txt"); Console.WriteLine(BookParser.ProduceReport(text)); }