Skip to content

Commit

Permalink
Merge branch 'main' into completed
Browse files Browse the repository at this point in the history
  • Loading branch information
tboychuk committed Aug 4, 2022
2 parents 4251b75 + 92139dc commit 51df2ed
Showing 1 changed file with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
package com.bobocode.cs;

import static java.lang.reflect.Modifier.isStatic;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import lombok.SneakyThrows;
import org.junit.jupiter.api.ClassOrderer.OrderAnnotation;
import org.junit.jupiter.api.*;

import java.lang.reflect.Field;
import java.util.Arrays;
Expand All @@ -15,15 +11,11 @@
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.SneakyThrows;
import org.junit.jupiter.api.ClassOrderer.OrderAnnotation;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestClassOrder;
import org.junit.jupiter.api.TestMethodOrder;

import static java.lang.reflect.Modifier.isStatic;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.*;

/**
* A Reflection-based step by step test for a {@link HashTable} class. PLEASE NOTE that Reflection API should not be used
Expand Down Expand Up @@ -310,10 +302,8 @@ void putTwoElementsWithTheSameHashCode() {
"put element updates the value and returns the previous one when key is the same, should not increase table size")
void putElementWithTheSameKey() {
hashTable.put("madmax", 833);
System.out.println(hashTable);

var previousValue = hashTable.put("madmax", 876);
System.out.println(hashTable);
var containsNewValueByKey = checkKeyValueExists("madmax", 876);

assertThat(previousValue).isEqualTo(833);
Expand Down Expand Up @@ -518,8 +508,6 @@ void resizeTable() {
addToTable("AaAa", 123);
addToTable("BBBB", 456);

System.out.println(hashTable);

hashTable.resizeTable(16);

assertThat(getInternalTable(hashTable)).hasSize(16);
Expand Down

0 comments on commit 51df2ed

Please sign in to comment.