package com.fewlaps.mentiondetector;

import org.junit.Ignore;
import org.junit.Test;

import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;

public class GetSequenceTest {

    @Test
    public void shouldReturnEmpty_whenTextDoesntHaveAnyMention() throws InterruptedException {
        String text = "hello";
        List<Sequence> sequences = new MentionDetector(text).getSequences();
        assertThat(sequences).isEmpty();
    }

    @Test
    public void shouldReturnASequence_whenTextHasOneMention() throws InterruptedException {
        String text = "hello @roc";
        List<Sequence> sequences = new MentionDetector(text).getSequences();
        assertThat(sequences).hasSize(1);
    }

    @Test
    public void shouldReturnASequence_whenTextHasTwoMentionsWrittenTogether() throws InterruptedException {
        String text = "hello @roc @esteve";
        List<Sequence> sequences = new MentionDetector(text).getSequences();
        assertThat(sequences).hasSize(1);
    }

    @Test
    public void shouldReturnTwoSequences_whenTextHasTwoMentionsWrittenSeparate() throws InterruptedException {
        String text = "hello @roc and @esteve";
        List<Sequence> sequences = new MentionDetector(text).getSequences();
        assertThat(sequences).hasSize(2);
    }

    @Test
    public void shouldReturnTwoSequences_whenTextHasThreeMentions_andFirstIsSeparatedOfSecondAndThird() throws InterruptedException {
        String text = "hello @roc and @esteve @aguilera";
        List<Sequence> sequences = new MentionDetector(text).getSequences();
        assertThat(sequences).hasSize(2);
    }

    @Test
    public void shouldReturnOneSequence_whenTextHasThreeMentions_separatedOnlyByLotsOfWhitespaces() throws InterruptedException {
        String text = "hello @roc    @boronat       @esteve        @aguilera";
        List<Sequence> sequences = new MentionDetector(text).getSequences();
        assertThat(sequences).hasSize(1);
    }
}

@@ -1684,37 +1684,36 @@
 ence_whenTextHas
-Three
+Four
 Mentions_separat
@@ -1918,32 +1918,32 @@
 getSequences();%0A
-
         assertTh
@@ -1973,11 +1973,359 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void shouldReturnThreeSequences_whenTextHasFourMentions_andTheSecondIsWrappedByBrackets() throws InterruptedException %7B%0A        String text = %22hello @roc    %7B@boronat%7D       @esteve        @aguilera%22;%0A        List%3CSequence%3E sequences = new MentionDetector(text).getSequences();%0A        assertThat(sequences).hasSize(3);%0A    %7D
 %0A%7D%0A

Adding passing test that checks that @roc {@boronat} @esteve @aguilera are three sequences