Example #1
0
 def testIfTryToFindDataFromInvalidColumnThenShouldTrowAnException(self):
     sudoku = SudokuBoard(3)
     try:
         sudoku.get_value('C', 4)
         self.fail("Did not raise the exception InvalidColumnException")
     except InvalidColumnException:
         pass
Example #2
0
 def test_given_a_valid_dictionary_then_should_convert_it_to_sudoku_table(self):
     sudoku = SudokuBoard(3)
     sudoku.from_dictionary(self.dic_with_data)
     
     rows = ['A', 'B', 'C']
     cols = range(1, 4)
     
     self.assertEqual(len(self.dic_with_data), len(sudoku.dic))
     
     for row in rows:
         for col in cols:
             self.assertEqual(self.dic_with_data[row + str(col)], sudoku.get_value(row, col))
Example #3
0
 def testIfTryToFindDataInRightCellThenShouldFindTheCorrectData(self):
     sudoku = SudokuBoard(3)
     sudoku.dic['C2'].set_value('4')
     value = sudoku.get_value('C', 2)
     self.assertEqual('4', value)