def test_assert_bomb(self): col = 12 row = 8 field = miner.start_matrix(col, row) miner.coloca_bomba(field, 3,7) self.assertEqual(field[3][7], -1)
def teste_verificar_bomba(self): col = 12 row = 8 matrix = miner.start_matrix(col, row) miner.coloca_bomba(matrix, 3,7) self.assertEqual(matrix[3][7], -1)
def teste_verificar_bomba(self): col = 12 row = 8 matrix = miner.start_matrix(col, row) miner.coloca_bomba(matrix, 3, 7) self.assertEqual(matrix[3][7], -1)
def test_assert_bomb(self): col = 12 row = 8 field = miner.start_matrix(col, row) miner.coloca_bomba(field, 3, 7) self.assertEqual(field[3][7], -1)
def test_2x2_field_with_1_bomb(self): col = 2 row = 2 field = miner.start_matrix(col, row) field = miner.coloca_bomba(field, 0, 0) computed_field = miner.compute_field(field) self.assertEqual(computed_field, [[-1, 1], [1, 1]])
def test_2x2_field_with_1_bomb(self): col = 2 row = 2 field = miner.start_matrix(col, row) field = miner.coloca_bomba(field, 0, 0) computed_cell = miner.compute_cell(field, 0, 1) self.assertEqual(computed_cell, 1)
def test_assert_near_bomb(self): col = 1 row = 1 field = miner.start_matrix(col, row) field = miner.coloca_bomba(field, 0, 0) computed_field = miner.compute_field(field) self.assertEqual(computed_field, field)
def teste_verificar_vizinhanca(self): col = 3 row = 3 matrix = miner.start_matrix(col, row) matrix = miner.coloca_bomba(matrix, 1, 1) matrix = miner.define_valor(matrix, 0, 0) self.assertEqual(matrix[0][0], 1)
def teste_row_only_matrix(self): col = 1 row = 8 matrix = miner.start_matrix(col, row) cells = 0 for i in matrix[0]: cells += 1 self.assertEqual(cells, row)
def test_row_only_field(self): col = 1 row = 8 field = miner.start_matrix(col, row) cells = 0 for i in field[0]: cells += 1 self.assertEqual(cells, row)
def teste_verificar_vizinhanca(self): col = 3 row = 3 matrix = miner.start_matrix(col, row) matrix = miner.coloca_bomba(matrix, 1,1) matrix = miner.define_valor(matrix, 0,0) self.assertEqual(matrix[0][0], 1)
def teste_col_only_matrix(self): col = 7 row = 1 matrix = miner.start_matrix(col, row) cells = 0 for i in matrix: cells += 1 self.assertEqual(cells, col)
def test_col_only_field(self): col = 7 row = 1 field = miner.start_matrix(col, row) cells = 0 for i in field: cells += 1 self.assertEqual(cells, col)
def test_3x3_field_with_4_bombs(self): col = row = 3 field = miner.start_matrix(col, row) field = miner.coloca_bomba(field, 0, 0) field = miner.coloca_bomba(field, 0, 1) field = miner.coloca_bomba(field, 0, 2) field = miner.coloca_bomba(field, 2, 0) computed_cell = miner.compute_cell(field, 1, 1) self.assertEqual(computed_cell, 4)
def teste_empty_matrix(self): col = 9 row = 8 matrix = miner.start_matrix(col, row) soma = 0 for linha in matrix: for celula in linha: soma += celula self.assertEqual(soma, 0)
def teste_square_matrix(self): col = 3 row = 3 matrix = miner.start_matrix(col, row) cells = 0 for i in matrix: for j in i: cells += 1 self.assertEqual(cells, col * row)
def test_empty_field(self): col = 9 row = 8 field = miner.start_matrix(col, row) soma = 0 for linha in field: for celula in linha: soma += celula self.assertEqual(soma, 0)