Example #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) 
Example #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) 
Example #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)
Example #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)
Example #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]])
Example #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)
Example #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]])
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)