diff --git a/src/test/java/BubbleSortTest.java b/src/test/java/BubbleSortTest.java new file mode 100644 index 0000000..c7ca252 --- /dev/null +++ b/src/test/java/BubbleSortTest.java @@ -0,0 +1,39 @@ +import static org.junit.jupiter.api.Assertions.assertArrayEquals; + +import org.junit.jupiter.api.Test; +import edu.ifrs.vvs.BubbleSort; + +public class BubbleSortTest { + + private BubbleSort bubbleSort = new BubbleSort(); + + //notação test pra indicar o método + //zero elementos + @Test + public void nadaComNenhum() { + int[] valores = {}; + bubbleSort.sort(valores); + } + + //um elemento + @Test + public void nadaComUm(){ + int[] valores = {2}; + + bubbleSort.sort(valores); + assertArrayEquals(new int[] {2}, valores); + + } + + @Test + public void sortValores(){ + int[] valores = {0, 200, -3, 14, 100}; + int[] ordemEsperada = {-3, 0, 14, 100, 200}; + + bubbleSort.sort(valores); + assertArrayEquals(ordemEsperada, valores); + } + +} + +//ao concluir, ir para o erlenmeyer (extensão de teste) \ No newline at end of file diff --git a/src/test/java/edu/ifrs/vvs/AppTest.java b/src/test/java/edu/ifrs/vvs/AppTest.java deleted file mode 100644 index 9677aa5..0000000 --- a/src/test/java/edu/ifrs/vvs/AppTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @License - * Copyright 2020 Bubble Sort Application - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package edu.ifrs.vvs; - -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -/** - * Unit test for simple App. - */ -class AppTest { - /** - * Rigorous Test. - */ - @Test - void testApp() { - assertEquals(1, 1); - } -}