From b7929f08cb3b60a387e04a5daf12d8d88669dc27 Mon Sep 17 00:00:00 2001 From: "d.kapustin" Date: Tue, 26 Sep 2023 15:00:56 +0300 Subject: [PATCH] =?UTF-8?q?6.0.7.=20=D0=9C=D0=B0=D1=81=D1=81=D0=B8=D0=B2?= =?UTF-8?q?=D1=8B=20=D0=B2=20=D1=82=D0=B5=D1=81=D1=82=D0=B0=D1=85.;=20http?= =?UTF-8?q?s://job4j.ru/profile/exercise/2/task-view/92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/ru/j4j/array/SquareTest.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/java/ru/j4j/array/SquareTest.java diff --git a/src/test/java/ru/j4j/array/SquareTest.java b/src/test/java/ru/j4j/array/SquareTest.java new file mode 100644 index 0000000..d74e7de --- /dev/null +++ b/src/test/java/ru/j4j/array/SquareTest.java @@ -0,0 +1,23 @@ +package ru.j4j.array; + +import static org.assertj.core.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +class SquareTest { + @Test + void whenBound3Then014() { + int bound = 3; + int[] result = Square.calculate(bound); + int[] expected = new int[] {0, 1, 4}; + assertThat(result).containsExactly(expected); + } + + @Test + void whenBound5Then014916() { + int bound = 5; + int[] result = Square.calculate(bound); + int[] expected = new int[] {0, 1, 4, 9, 16}; + assertThat(result).containsExactly(expected); + } +} \ No newline at end of file