package com.matao.chapter01;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

public class Q1_IsUniqueTest {

    @Test
    @DisplayName("test isUniqueChars with null")
    void testNull() {
        Assertions.assertFalse(Q1_IsUnique.isUniqueChars(null));
    }

    @Test
    @DisplayName("test isUniqueChars with empty string")
    void testEmptyString() {
        Assertions.assertTrue(Q1_IsUnique.isUniqueChars(""));
    }

    @Test
    @DisplayName("test isUniqueChars with single char")
    void testSingleChar() {
        Assertions.assertTrue(Q1_IsUnique.isUniqueChars("x"));
    }

    @Test
    @DisplayName("test isUniqueChars with multi-chars")
    void testMultiChars() {
        Assertions.assertFalse(Q1_IsUnique.isUniqueChars("fghjhjsfasd"));
    }

    /**
     * ----------------------------------------Test BitSet Solution below--------------------------------------------------------------------------
     */

    @Test
    @DisplayName("test isUniqueCharsByBitSet with null")
    void testBitSetNull() {
        Assertions.assertFalse(Q1_IsUnique.isUniqueCharsByBitSet(null));
    }

    @Test
    @DisplayName("test isUniqueCharsByBitSet with empty string")
    void testBitSetEmptyString() {
        Assertions.assertTrue(Q1_IsUnique.isUniqueCharsByBitSet(""));
    }

    @Test
    @DisplayName("test isUniqueCharsByBitSet with single char")
    void testBitSetSingleChar() {
        Assertions.assertTrue(Q1_IsUnique.isUniqueChars("x"));
    }

    @Test
    @DisplayName("test isUniqueCharsByBitSet with multi-chars")
    void testBitSetMultiChars() {
        Assertions.assertFalse(Q1_IsUnique.isUniqueChars("fghjhjsfasd"));
    }
}

@@ -156,16 +156,17 @@
  class Q
+0
 1_IsUniq
@@ -174,16 +174,16 @@
 eTest %7B%0A
-
 %0A    @Te
@@ -280,32 +280,33 @@
 ns.assertFalse(Q
+0
 1_IsUnique.isUni
@@ -448,32 +448,33 @@
 ons.assertTrue(Q
+0
 1_IsUnique.isUni
@@ -612,32 +612,33 @@
 ons.assertTrue(Q
+0
 1_IsUnique.isUni
@@ -778,32 +778,33 @@
 ns.assertFalse(Q
+0
 1_IsUnique.isUni
@@ -1120,32 +1120,33 @@
 ns.assertFalse(Q
+0
 1_IsUnique.isUni
@@ -1310,32 +1310,33 @@
 ons.assertTrue(Q
+0
 1_IsUnique.isUni
@@ -1504,16 +1504,17 @@
 rtTrue(Q
+0
 1_IsUniq
@@ -1644,32 +1644,32 @@
 tMultiChars() %7B%0A
-
         Assertio
@@ -1684,16 +1684,17 @@
 tFalse(Q
+0
 1_IsUniq

add test cases for Q01 IsUnique