forked from jvm-coder/Hacktoberfest2022_aakash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBTreeTests.java
More file actions
29 lines (21 loc) · 1.05 KB
/
BTreeTests.java
File metadata and controls
29 lines (21 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.jwetherell.algorithms.data_structures.test;
import static org.junit.Assert.assertTrue;
import java.util.Collection;
import org.junit.Test;
import com.jwetherell.algorithms.data_structures.BTree;
import com.jwetherell.algorithms.data_structures.test.common.JavaCollectionTest;
import com.jwetherell.algorithms.data_structures.test.common.TreeTest;
import com.jwetherell.algorithms.data_structures.test.common.Utils;
import com.jwetherell.algorithms.data_structures.test.common.Utils.TestData;
public class BTreeTests {
@Test
public void testBTree() {
TestData data = Utils.generateTestData(1000);
String bstName = "B-Tree";
BTree<Integer> bst = new BTree<Integer>(2);
Collection<Integer> bstCollection = bst.toCollection();
assertTrue(TreeTest.testTree(bst, Integer.class, bstName, data.unsorted, data.invalid));
assertTrue(JavaCollectionTest.testCollection(bstCollection, Integer.class, bstName,
data.unsorted, data.sorted, data.invalid));
}
}