From a7fb4c22dae5c80f64fc1cd3da1de1de1aefb0e2 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Sat, 13 Dec 2025 17:50:23 +0530 Subject: [PATCH] Add displaname tree-building --- .../tree-building/src/test/java/BuildTreeTest.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/exercises/practice/tree-building/src/test/java/BuildTreeTest.java b/exercises/practice/tree-building/src/test/java/BuildTreeTest.java index c34bb3cc9..e11bc2990 100644 --- a/exercises/practice/tree-building/src/test/java/BuildTreeTest.java +++ b/exercises/practice/tree-building/src/test/java/BuildTreeTest.java @@ -2,6 +2,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.util.ArrayList; @@ -9,6 +10,7 @@ public class BuildTreeTest { @Test + @DisplayName("Empty list") public void testEmptyList() throws InvalidRecordsException { ArrayList records = new ArrayList<>(); @@ -18,6 +20,7 @@ public void testEmptyList() throws InvalidRecordsException { @Disabled("Remove to run test") @Test + @DisplayName("Single record") public void testOneRecord() throws InvalidRecordsException { ArrayList records = new ArrayList<>(); Record record = new Record(0, 0); @@ -30,6 +33,7 @@ public void testOneRecord() throws InvalidRecordsException { @Disabled("Remove to run test") @Test + @DisplayName("Three records in order") public void testThreeRecordsInOrder() throws InvalidRecordsException { ArrayList records = new ArrayList<>(); records.add(new Record(0, 0)); @@ -48,6 +52,7 @@ public void testThreeRecordsInOrder() throws InvalidRecordsException { @Disabled("Remove to run test") @Test + @DisplayName("Three records in reverse order") public void testThreeRecordsInReverseOrder() throws InvalidRecordsException { ArrayList records = new ArrayList<>(); records.add(new Record(2, 0)); @@ -66,6 +71,7 @@ public void testThreeRecordsInReverseOrder() throws InvalidRecordsException { @Disabled("Remove to run test") @Test + @DisplayName("More than two children") public void testRecordsWithMoreThanTwoChildren() throws InvalidRecordsException { ArrayList records = new ArrayList<>(); records.add(new Record(0, 0)); @@ -83,11 +89,11 @@ public void testRecordsWithMoreThanTwoChildren() throws InvalidRecordsException assertThat(root.getChildren().get(0).getNodeId()).isEqualTo(1); assertThat(root.getChildren().get(1).getNodeId()).isEqualTo(2); assertThat(root.getChildren().get(2).getNodeId()).isEqualTo(3); - } @Disabled("Remove to run test") @Test + @DisplayName("Binary tree") public void testBinaryTree() throws InvalidRecordsException { ArrayList records = new ArrayList<>(); records.add(new Record(6, 2)); @@ -119,6 +125,7 @@ public void testBinaryTree() throws InvalidRecordsException { @Disabled("Remove to run test") @Test + @DisplayName("Unbalanced tree") public void testUnbalancedTree() throws InvalidRecordsException { ArrayList records = new ArrayList<>(); records.add(new Record(0, 0)); @@ -149,6 +156,7 @@ public void testUnbalancedTree() throws InvalidRecordsException { @Disabled("Remove to run test") @Test + @DisplayName("Root has parent") public void testRootNodeHasParent() { ArrayList records = new ArrayList<>(); records.add(new Record(0, 1)); @@ -163,6 +171,7 @@ public void testRootNodeHasParent() { @Disabled("Remove to run test") @Test + @DisplayName("No root node") public void testNoRootNode() { ArrayList records = new ArrayList<>(); records.add(new Record(1, 0)); @@ -177,6 +186,7 @@ public void testNoRootNode() { @Disabled("Remove to run test") @Test + @DisplayName("Non continuous records") public void testNonContinuousRecords() { ArrayList records = new ArrayList<>(); records.add(new Record(2, 0)); @@ -193,6 +203,7 @@ public void testNonContinuousRecords() { @Disabled("Remove to run test") @Test + @DisplayName("Cycle indirectly") public void testCycleIndirectly() { ArrayList records = new ArrayList<>(); records.add(new Record(5, 2));