Commit e663f9aa authored by emahmoud3's avatar emahmoud3
Browse files

Making Software testing for buggy-crossword.

parent 579f480d
from unittest import TestCase
from main import Crossword
BASE_CROSSWORD = Crossword((
(None, None, None, None, None, None),
(None, 'B', 'U', 'G', 'S', None),
(None, 'U', 'N', 'I', 'T', None),
(None, 'G', 'I', 'V', 'E', None),
(None, 'S', 'T', 'E', 'M', None),
(None, None, None, None, None, None),
), {
'BUGS': 'Informal name for software faults',
'UNIT': 'Very traceable software testing',
'GIVE': 'To make a present of something',
'STEM': 'Group of disciplines including SE',
})
ONE_WORD_ROW_CROSSWORD = Crossword((
(None, None, None, None, None, None),
(None, 'B', 'U', 'G', 'S', None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
'BUGS': 'Informal name for software faults',
})
ONE_WORD_COLUMN_CROSSWORD = Crossword((
(None, None, None, None, None, None),
(None, 'B', None, None, None, None),
(None, 'U', None, None, None, None),
(None, 'G', None, None, None, None),
(None, 'S', None, None, None, None),
(None, None, None, None, None, None),
), {
'BUGS': 'Informal name for software faults',
})
TWO_WORD_ROW_CROSSWORD = Crossword((
(None, None, None, None, None, None),
(None, 'B', 'U', 'G', None, 'A'),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
'BUG': 'Informal name for software faults',
'A': 'Indefinite article'
})
TWO_WORD_COLUMN_CROSSWORD = Crossword((
(None, 'B', None, None, None, None),
(None, 'U', None, None, None, None),
(None, 'G', None, None, None, None),
(None, 'S', None, None, None, None),
(None, None, None, None, None, None),
(None, 'A', None, None, None, None),
), {
'BUG': 'Informal name for software faults',
'A': 'Indefinite article'
})
NO_WORDS_CROSSWORD = Crossword((
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
'BUG': 'Informal name for software faults',
'A': 'Indefinite article'
})
BUG_TEST_COLUMN_CROSSWORD = Crossword((
(None, 'J', None, None, None, None),
(None, 'U', None, None, None, None),
(None, 'M', None, None, None, None),
(None, 'P', None, None, None, None),
(None, 'S', None, None, None, None),
(None, 'T', None, None, None, None),
(None, 'A', None, None, None, None),
(None, 'R', None, None, None, None),
(None, 'T', None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
'JUMPSTART': 'To get something going',
'START': 'The start of something'
})
BUG_TEST_NUMBERED_CROSSWORD = Crossword((
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
'JUMPSTART': 'To get something going',
'START': 'The start of something'
})
TEST_NUMBERED_CROSSWORD_FRAME_1 = Crossword((
(None, 'L', None, None, None, None),
('L', None, 'L', None, None, None),
(None, 'L', None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
})
TEST_NUMBERED_CROSSWORD_FRAME_2 = Crossword((
(None, None, None, None, None, None),
('T', None, None, None, None, None),
('O', None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
})
TEST_NUMBERED_CROSSWORD_FRAME_3 = Crossword((
(None, 'L', None, None, None, None),
('L', None, 'L', None, None, None),
(None, 'L', None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
})
TEST_NUMBERED_CROSSWORD_FRAME_4 = Crossword((
('O', None, None, None, None, None),
('L', 'O', 'L', 'S', None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
})
TEST_NUMBERED_CROSSWORD_FRAME_5 = Crossword((
(None, None, None, None, None, None),
('L', 'O', 'L', 'S', 'S', 'S'),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
})
TEST_NUMBERED_CROSSWORD_FRAME_6 = Crossword((
(None, None, None, None, None, None),
(None, 'T', None, None, None, None),
(None, 'O', None, 'C', 'A', 'N'),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
})
TEST_NUMBERED_CROSSWORD_FRAME_7 = Crossword((
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, 'O', None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
})
TEST_NUMBERED_CROSSWORD_FRAME_8 = Crossword((
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
})
TEST_NUMBERED_CROSSWORD_FRAME_9 = Crossword((
(None, None, None, None, None, None),
(None, None, 'L', None, None, None),
(None, None, 'L', 'L', None, None),
(None, None, 'L', None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
})
TEST_NUMBERED_CROSSWORD_FRAME_10 = Crossword((
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, 'L', None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
(None, None, None, None, None, None),
), {
})
class TestCrossword(TestCase):
def test_get_across_clue_frame_1(self):
actual = ONE_WORD_ROW_CROSSWORD.get_across_clue(1, 1)
expected = 'Informal name for software faults'
self.assertEqual(actual, expected)
def test_get_down_clue_frame_2(self):
actual = ONE_WORD_COLUMN_CROSSWORD.get_down_clue(1, 2)
expected = None
self.assertEqual(actual, expected)
def test_get_across_clue_frame_3(self):
actual = TWO_WORD_ROW_CROSSWORD.get_across_clue(0, 1)
expected = None
self.assertEqual(actual, expected)
def test_get_across_clue_frame_4(self):
actual = TWO_WORD_COLUMN_CROSSWORD.get_across_clue(1, 3)
expected = None
self.assertEqual(actual, expected)
def test_get_across_clue_frame_5(self):
actual = NO_WORDS_CROSSWORD.get_across_clue(100, 100)
expected = None
self.assertEqual(actual, expected)
def test_get_across_clue_bug_case(self):
actual = BUG_TEST_COLUMN_CROSSWORD.get_down_clue(4, 1)
expected = None
self.assertEqual(actual, expected)
def test_is_numbered_frame_1(self):
actual = TEST_NUMBERED_CROSSWORD_FRAME_1.is_numbered(1, 1)
expected = None
self.assertEqual(actual, expected)
def test_is_numbered_frame_2(self):
actual = TEST_NUMBERED_CROSSWORD_FRAME_2.is_numbered(1, 0)
expected = True
self.assertEqual(actual, expected)
def test_is_numbered_frame_3(self):
actual = TEST_NUMBERED_CROSSWORD_FRAME_3.is_numbered(100, 100)
expected = None
self.assertEqual(actual, expected)
def test_is_numbered_frame_4(self):
actual = TEST_NUMBERED_CROSSWORD_FRAME_4.is_numbered(1, 0)
expected = True
self.assertEqual(actual, expected)
def test_is_numbered_frame_5(self):
actual = TEST_NUMBERED_CROSSWORD_FRAME_5.is_numbered(1, 0)
expected = True
self.assertEqual(actual, expected)
def test_is_numbered_frame_6(self):
actual_1 = TEST_NUMBERED_CROSSWORD_FRAME_6.is_numbered(1, 1)
actual_2 = TEST_NUMBERED_CROSSWORD_FRAME_6.is_numbered(2, 3)
expected = True
self.assertEqual(actual_1, expected)
self.assertEqual(actual_2, expected)
def test_is_numbered_frame_7(self):
actual = TEST_NUMBERED_CROSSWORD_FRAME_7.is_numbered(2, 1)
expected = False
self.assertEqual(actual, expected)
def test_is_numbered_frame_8(self):
actual = TEST_NUMBERED_CROSSWORD_FRAME_8.is_numbered(2, 2)
expected = None
self.assertEqual(actual, expected)
def test_is_numbered_frame_9(self):
actual = TEST_NUMBERED_CROSSWORD_FRAME_9.is_numbered(2, 2)
expected = True
self.assertEqual(actual, expected)
def test_is_numbered_frame_10(self):
actual = TEST_NUMBERED_CROSSWORD_FRAME_10.is_numbered(3, 2)
expected = False
self.assertEqual(actual, expected)
def test_is_numbered_bug_case(self):
actual = TEST_NUMBERED_CROSSWORD_FRAME_5.is_numbered(1, 0)
expected = True
self.assertEqual(actual, expected)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment