Пример #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) 
Пример #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) 
Пример #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)
Пример #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)
Пример #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]])
Пример #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)
Пример #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]])
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)