Beispiel #1
0
	def test_costruct_y_create_a_correct_y_list(self):
		Row, Column = 3,3
		matrix_lenght = Row * Column
		list_of_X=self.create_x_values
		list_of_Y = dict()
		expected_result=costructy(matrix_lenght,Row,Column,list_of_Y)
		x_algorithm1 = XAlgorithm(self.mtrxhandler_unsolvable)
		actual_result=x_algorithm1.costruct_y(matrix_lenght,Row,Column,list_of_Y)
		self.assertEqual(expected_result,actual_result)
Beispiel #2
0
	def test_first_list(self):
		expected_result=gen_list("rc",9,0,9)
		x_algorithm1 = XAlgorithm(self.mtrxhandler_unsolvable)
		actual_result=x_algorithm1.first_list("rc",9,0,9)
		self.assertEqual(expected_result,actual_result)	
Beispiel #3
0
	def test_solve_sudoku_unsolvable_caseunsolvable_XAlgorithm(self):
		x_algorithm1 = XAlgorithm(self.mtrxhandler_unsolvable)
		self.assertEqual(None, x_algorithm1.solve_sudoku((3,3)))	
Beispiel #4
0
	def test_solve_unsolvable_casemultiple_XAlgorithm(self):
		x_algorithm = XAlgorithm(self.mtrxhandler_multiple)
		self.assertEqual(None, x_algorithm.solve())
Beispiel #5
0
	def test_if_does_not_costruct_wrong_x_list_values(self):
		x_algorithm = XAlgorithm(self.mtrxhandler)
		actual_value=x_algorithm.costruct_x(9)
		self.assertNotEqual(actual_value,self.create_wrong_x_values)
Beispiel #6
0
	def test_costruct_x_create_a_correct_X_list(self):
		x_algorithm = XAlgorithm(self.mtrxhandler)
		actual_value=x_algorithm.costruct_x(9)
		self.assertEqual(actual_value,self.create_x_values)
Beispiel #7
0
	def test_solve(self):
		x_algorithm = XAlgorithm(self.mtrxhandler)
		self.assertEqual(self.mtrxhandler_solved.first_matrix, x_algorithm.solve().first_matrix)