Ejemplo n.º 1
0
	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) 
Ejemplo n.º 2
0
 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) 
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
    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)
Ejemplo n.º 5
0
	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]])
Ejemplo n.º 6
0
	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)
Ejemplo n.º 7
0
    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]])
Ejemplo n.º 8
0
	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)
Ejemplo n.º 9
0
    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)
Ejemplo n.º 10
0
    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)
Ejemplo n.º 11
0
    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)
Ejemplo n.º 12
0
 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)
Ejemplo n.º 13
0
    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)
Ejemplo n.º 14
0
 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)
Ejemplo n.º 15
0
    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)
Ejemplo n.º 16
0
    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)
Ejemplo n.º 17
0
    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)
Ejemplo n.º 18
0
 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)
Ejemplo n.º 19
0
	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)
Ejemplo n.º 20
0
	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)
Ejemplo n.º 21
0
	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)
Ejemplo n.º 22
0
 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)
Ejemplo n.º 23
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)
Ejemplo n.º 24
0
    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)
Ejemplo n.º 25
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)
Ejemplo n.º 26
0
	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)
Ejemplo n.º 27
0
    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)
Ejemplo n.º 28
0
    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)