diff --git a/tests/anagram_check.py b/tests/anagram_check.py new file mode 100644 index 0000000..f3cc27b --- /dev/null +++ b/tests/anagram_check.py @@ -0,0 +1,20 @@ +from unittest import TestCase + +from benchmark.anagram_check import anagram_check + + +class Test_anagram_check(TestCase): + def test_anagram_check_1(self): + assert anagram_check(s1='B', s2='o8') == False + + def test_anagram_check_2(self): + assert anagram_check(s1=' ', s2='u') == False + + def test_anagram_check_3(self): + assert anagram_check(s1='', s2='') == True + + def test_anagram_check_4(self): + assert anagram_check(s1='?8H', s2='') == False + + def test_anagram_check_5(self): + assert anagram_check(s1='@m', s2='Pj') == False \ No newline at end of file diff --git a/tests/cd_count.py b/tests/cd_count.py new file mode 100644 index 0000000..81b863e --- /dev/null +++ b/tests/cd_count.py @@ -0,0 +1,23 @@ +from unittest import TestCase + +from benchmark.common_divisor_count import cd_count + + +class Test_cd_count(TestCase): + def test_cd_count_1(self): + assert cd_count(a=-946, b=0) == 2 + + def test_cd_count_2(self): + assert cd_count(a=873, b=164) == 1 + + def test_cd_count_3(self): + assert cd_count(a=0, b=-90) == 2 + + def test_cd_count_4(self): + assert cd_count(a=783, b=-749) == 1 + + def test_cd_count_5(self): + assert cd_count(a=621, b=-23) == 2 + + def test_cd_count_6(self): + assert cd_count(a=-635, b=444) == 1 \ No newline at end of file diff --git a/tests/check_armstrong.py b/tests/check_armstrong.py new file mode 100644 index 0000000..cc42a7a --- /dev/null +++ b/tests/check_armstrong.py @@ -0,0 +1,20 @@ +from unittest import TestCase + +from benchmark.check_armstrong import check_armstrong + + +class Test_check_armstrong(TestCase): + def test_check_armstrong_1(self): + assert check_armstrong(n=370) == True + + def test_check_armstrong_2(self): + assert check_armstrong(n=5) == False + + def test_check_armstrong_3(self): + assert check_armstrong(n=1) == True + + def test_check_armstrong_4(self): + assert check_armstrong(n=0) == True + + def test_check_armstrong_5(self): + assert check_armstrong(n=346) == False \ No newline at end of file diff --git a/tests/decrypt.py b/tests/decrypt.py new file mode 100644 index 0000000..33135e6 --- /dev/null +++ b/tests/decrypt.py @@ -0,0 +1,8 @@ +from unittest import TestCase + +from benchmark.caesar_cipher import decrypt + + +class Test_decrypt(TestCase): + def test_decrypt_1(self): + assert decrypt(strng='\\nEGQ&', key=41) == '3E{}(ý' \ No newline at end of file diff --git a/tests/encrypt.py b/tests/encrypt.py new file mode 100644 index 0000000..3d0bfb2 --- /dev/null +++ b/tests/encrypt.py @@ -0,0 +1,11 @@ +from unittest import TestCase + +from benchmark.caesar_cipher import encrypt + + +class Test_encrypt(TestCase): + def test_encrypt_1(self): + assert encrypt(strng='ToU}[G4}', key=70) == ';V