Пример #1
0
 public void Test100CharLimit()
 {
     _storage.Clear();
      Dictionary<string, int> testDict = new Dictionary<string, int>();
      testDict.Add("this", 33);
      testDict.Add("is", 33);
      testDict.Add("a", 16);
      testDict.Add("statement", 16);
      testDict.Add("including5", 16);
      testDict.Add("and", 16);
      testDict.Add("so", 16);
      testDict.Add("but", 16);
      testDict.Add("not", 16);
      IProcessor processor = new Processor();
      string input = @"This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is a statement, and so: is this, including5, but not #e@
     This is.";
      processor.GetInput(input);
      processor.ShowStatistics(Display);
      Assert.IsTrue(StatisticCheck(testDict));
 }
Пример #2
0
 public void TestSentenceSuccess()
 {
     IProcessor processor = new Processor();
     string input = "This is a statement, and so is this.";
     processor.GetInput(input);
     processor.ShowStatistics(Display);
 }
Пример #3
0
 public void TestSentenceFailure2()
 {
     IProcessor processor = new Processor();
     string input = "";
     processor.GetInput(input);
     processor.ShowStatistics(Display);
 }
Пример #4
0
 static void Main(string[] args)
 {
     //This can be wired via spring to accomodate extended use cases as mentioned in README.docs
     //which can take filename as an input and process the stream event based
     IProcessor processor = new Processor();
     Console.Write("Please enter the sentence to analyse:");
     string input = Console.ReadLine();
     processor.GetInput(input);
     processor.ShowStatistics(Display);
     Console.ReadKey();
 }
Пример #5
0
 public void TestNumberFilter()
 {
     _storage.Clear();
     Dictionary<string, int> testDict = new Dictionary<string, int>();
     testDict.Add("this", 2);
     testDict.Add("is", 2);
     testDict.Add("a", 1);
     testDict.Add("statement", 1);
     testDict.Add("including", 1);
     testDict.Add("and", 1);
     testDict.Add("so", 1);
     IProcessor processor = new Processor();
     string input = "This is a statement, and so is this, including 45.";
     processor.GetInput(input);
     processor.ShowStatistics(Display);
     Assert.IsTrue(StatisticCheck(testDict));
 }