package com.github.bot.curiosone.core.nlp;

// SUPPRESS CHECKSTYLE AvoidStarImport
import static org.junit.Assert.*;

import java.util.List;

import org.junit.Test;

public class PhraseTest {
  @Test
  public void testInstantiation() {
    Phrase classUnderTest = new Phrase("The cat is on the table!");
    assertTrue(classUnderTest instanceof Phrase);
  }

  @Test
  public void testEquals() {
    Phrase classUnderTest = new Phrase("The cat is on the table!");
    Phrase classUnderTestClone = new Phrase("The cat is on the table!");
    assertEquals(classUnderTest, classUnderTest);
    assertEquals(classUnderTest, classUnderTestClone);
    assertNotEquals(null, classUnderTest);
    assertNotEquals(new StringBuffer("something different"), classUnderTest);

    classUnderTest = new Phrase("This happens with the 42 number");
    classUnderTestClone = new Phrase("This happens with the 42 number");
    assertEquals(classUnderTest, classUnderTestClone);
  }

  @Test
  public void testExtract() {
    List<Phrase> phrases = Phrase.extract("The cat is on the table! But I love dogs.");
    assertEquals(2, phrases.size());
  }

  @Test
  public void testGetText() {
    Phrase p = new Phrase("Why is the cat always on the table?");
    assertEquals("Why is the cat always on the table?", p.getText());
    assertNotEquals("Why is the dragon always on the table?", p.getText());
  }
}

@@ -1019,17 +1019,99 @@
 %3E phrase
-s
+ = Phrase.extract(%22All by myself%22);%0A    assertEquals(1, phrase.size());%0A%0A    phrase
  = Phras
@@ -1192,17 +1192,170 @@
 , phrase
-s
+.size());%0A%0A    phrase = Phrase.extract(%0A        %22This the first sentence. Time for the second sentence! What about the third?%22);%0A    assertEquals(3,phrase
 .size())
@@ -1534,16 +1534,58 @@
 Text());
+%0A%0A    p = new Phrase(%22I l0v3 numb3rs111%22);
 %0A    ass
@@ -1591,19 +1591,16 @@
 sert
-Not
 Equals(%22
 Why 
@@ -1599,46 +1599,25 @@
 ls(%22
-Why is the dragon always on the table?
+I l0v3 numb3rs111
 %22, p

improve Phrase tests