Beispiel #1
0
    def test_get_alignment(self):
        # Arrange
        name = 'NShip'
        type_ = 'Battle'
        align = 'us'
        x_location = 2
        y_location = 2

        # Act
        ship = Ship(name, type_, x_location, y_location, align)
        result = ship.get_alignment()
        print(result)

        # Assert
        self.assertEqual(align, result)
Beispiel #2
0
    def test_get_alignment_incorrect_align_name(self):
        # Arrange
        name = 'NShip'
        type_ = 'Battle'
        align = 'Use'
        x_location = 2
        y_location = 2

        # Act
        ship = Ship(name, type_, x_location, y_location, align)

        # Assert
        try:
            result = ship.get_alignment()
            print(result)
        except ValueError:
            print("Pass")
            self.assertTrue(True)