package net.squanchy.tweets.parsing;

import net.squanchy.tweets.model.TweetSpannableText;

import org.junit.Test;

import static org.junit.Assert.assertEquals;


public class SpannableTextExtractorTest {

    @Test
    public void testMentionIsExtractedCorrectly() throws Exception {
        int start = 23;
        int end = 34;
        String text = "#droidconit";

        TweetSpannableText data = SpannableTextExtractor.extract("Look who's speaking at #droidconit this year! #Torino #android #adroiddev #AndDev https://t.co/wOMBeVINLW https://t.co/La0kCuU4aa", start, end);

        assertEquals(text, data.text());
    }
}

@@ -131,35 +131,50 @@
 org.
-junit
+fest.assertions.api
 .Assert
+ions
 .assert
-Equals;%0A
+That;
 %0A%0Apu
@@ -222,165 +222,303 @@
     
-@Test%0A    public void testMentionIsExtractedCorrectly() throws Exception %7B%0A        int start = 23
+private static final String TWEET_TEXT = %22@tiwiz look who's speaking at @droidconit this year! https://t.co/wOMBeVINLW #Torino @android #adroiddev #AndDev https://t.co/La0kCuU4aa%22
 ;%0A
+%0A
     
-    int end = 34;%0A        String text = %22#droidconit%22;
+@Test%0A    public void givenAnyText_andARange_whenExtractingSpannableText_thenReturnsACorrectSpannableText() %7B
 %0A%0A  
@@ -542,20 +542,29 @@
 bleText 
-data
+spannableText
  = Spann
@@ -593,155 +593,129 @@
 act(
-%22Look who's speaking at #droidconit this year! #Torino #android #adroiddev #AndDev https://t.co/wOMBeVINLW https://t.co/La0kCuU4aa%22, start, end
+TWEET_TEXT, 30, 41);%0A%0A        TweetSpannableText expectedSpannableText = TweetSpannableText.from(%22@droidconit%22, 30, 41
 );%0A
-%0A
     
@@ -728,32 +728,59 @@
 sert
-Equals(text, data.t
+That(spannableText).isEqualTo(expectedSpannableT
 ext
-()
 );%0A 

Improve SpannableTextExtractor test