/*
 * Copyright (c) 2018.
 *
 * This file is part of AvaIre.
 *
 * AvaIre is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AvaIre is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AvaIre.  If not, see <https://www.gnu.org/licenses/>.
 *
 *
 */

package com.avairebot.utilities;

import com.avairebot.BaseTest;
import org.junit.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class ArrayTests extends BaseTest {

    @Test
    public void testStringIsSplitBySpaces() {
        // 8 Words sentence
        String message = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";

        assertEquals(8, ArrayUtil.toArguments(message).length);
    }

    @Test
    public void testStringIsSplitByQuotes() {
        // 17 in total, with 7 of them being in quotes, should equal to 12 words by method
        String message = "Excepteur \"sint occaecat cupidatat\" non proident, sunt in culpa \"qui officia deserunt mollit\" anim id est laborum.";

        assertEquals(12, ArrayUtil.toArguments(message).length);
    }
}

@@ -1498,11 +1498,268 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testStringIsSplitWithEmptyStartPhrase() %7B%0A        // Two in total; one empty set and one whole phrase%0A        String message = %22%5C%22%5C%22 %5C%22lorem ipsum%5C%22%22;%0A        %0A        assertEquals(2, ArrayUtil.toArguments(message).length);%0A    %7D
 %0A%7D%0A

Create unit test for array utility to check empty quotes (#140)