def test__equals__shouldReturnFalse__whenNameIsDifferent(self):
        # Arrange
        location_a = Location(anon_string())
        location_b = Location(anon_string())

        # Act
        actual = (location_a == location_b)
        # Assert
        self.assertFalse(actual)
Example #2
0
    def test__equals__shouldReturnFalse__whenNameIsDifferent(self):
        # Arrange
        item_a = Item(anon_string())
        item_b = Item(anon_string())

        # Act
        actual = (item_a == item_b)

        # Assert
        self.assertFalse(actual)
Example #3
0
    def test__hash__shouldReturnDifferentHash__whenNameIsDifferent(self):
        # Arrange
        item_a = Item(anon_string())
        item_b = Item(anon_string())

        # Act
        hash_a = hash(item_a)
        hash_b = hash(item_b)

        # Assert
        self.assertNotEqual(hash_a, hash_b)
Example #4
0
    def test__equals__shouldReturnFalse__whenUPIDIsDifferentAndNameIsDifferent(
            self):
        # Arrange
        player_a = Player(anon_string(), anon_upid())
        player_b = Player(anon_string(), anon_upid())

        # Act
        actual = (player_a == player_b)

        # Assert
        self.assertFalse(actual)
    def test__hash__shouldReturnDifferentHash__whenNameIsDifferent(self):
        # Arrange
        location_a = Location(anon_string())
        location_b = Location(anon_string())

        # Act
        hash_a = location_a
        hash_b = location_b

        # Assert
        self.assertNotEqual(hash_a, hash_b)
Example #6
0
    def test__hash__shouldReturnSameHash__whenUPIDIsSame(self):
        # Arrange
        upid = anon_upid()
        player_a = Player(anon_string(), upid)
        player_b = Player(anon_string(), upid)

        # Act
        hash_a = hash(player_a)
        hash_b = hash(player_b)

        # Assert
        self.assertEqual(hash_a, hash_b)
Example #7
0
    def test__equals__shouldReturnTrue__whenUPIDIsIdenticalAndNameIsDifferent(
            self):
        # Arrange
        upid = anon_upid()
        player_a = Player(anon_string(), upid)
        player_b = Player(anon_string(), upid)

        # Act
        actual = (player_a == player_b)

        # Assert
        self.assertTrue(actual)
Example #8
0
    def test__name__shouldReturnName__whenAccessed(self):
        # Arrange
        expected_name = anon_string()
        item = Item(expected_name)

        # Act
        actual = item.name

        # Assert
        self.assertEqual(expected_name, actual)
Example #9
0
    def test__str__shouldReturnStringForm(self):
        # Arrange
        expected_name = anon_string()
        item = Item(expected_name)

        # Act
        actual = str(item)

        # Assert
        self.assertEqual(expected_name, actual)
Example #10
0
    def test__name__shouldReturnName__whenAccessing(self):
        # Arrange
        expected_name = anon_string()
        location = Location(expected_name)

        # Act
        name = location.name

        # Assert
        self.assertEqual(expected_name, name)
Example #11
0
    def test__str__shouldReturnLocationName(self):
        # Arrange
        expected_name = anon_string()
        location = Location(expected_name)

        # Act
        actual = str(location)

        # Assert
        self.assertEquals(expected_name, actual)
Example #12
0
    def test__equals__shouldReturnTrue__whenNameIsSame(self):
        # Arrange
        name = anon_string()
        location_a = Location(name)
        location_b = Location(name)

        # Act
        actual = (location_a == location_b)
        # Assert
        self.assertTrue(actual)
Example #13
0
    def test__repr__shouldReturnRepresentation(self):
        # Arrange
        name = anon_string()
        location = Location(name)
        expected = "%s(\"%s\")" % (Location.__name__, name)

        # Act
        actual = repr(location)

        # Assert
        self.assertEquals(expected, actual)
Example #14
0
    def test__upid__shouldReturnUPID__whenConstructedWithStr(self):
        # Arrange
        expected_upid = anon_upid()
        player = Player(anon_string(), str(expected_upid))

        # Act
        actual = player.upid

        # Assert
        self.assertIsInstance(actual, UPID)
        self.assertEqual(expected_upid, actual)
Example #15
0
    def test__equals__shouldReturnTrue__whenNameIsSame(self):
        # Arrange
        name = anon_string()
        item_a = Item(name)
        item_b = Item(name)

        # Act
        actual = (item_a == item_b)

        # Assert
        self.assertTrue(actual)
Example #16
0
    def test__repr__shouldReturnRepresentation(self):
        # Arrange
        name = anon_string()
        expected_string = "%s(\"%s\")" % (Item.__name__, name)
        item = Item(name)

        # Act
        actual = repr(item)

        # Assert
        self.assertEqual(expected_string, actual)
Example #17
0
    def test__str__shouldReturnStringForm(self):
        # Arrange
        name = anon_string()
        expected_string = name
        player = Player(name, anon_upid())

        # Act
        actual = str(player)

        # Assert
        self.assertEqual(expected_string, actual)
Example #18
0
    def test__hash__shouldReturnSameHash__whenNameIsSame(self):
        # Arrange
        name = anon_string()
        location_a = Location(name)
        location_b = Location(name)

        # Act
        hash_a = location_a
        hash_b = location_b

        # Assert
        self.assertEqual(hash_a, hash_b)
Example #19
0
    def test__repr__shouldReturnRepresentation(self):
        # Arrange
        name = anon_string()
        upid = anon_upid()
        expected_string = "%s(\"%s\",%s)" % (Player.__name__, name, repr(upid))
        player = Player(name, upid)

        # Act
        actual = repr(player)

        # Assert
        self.assertEqual(expected_string, actual)
Example #20
0
    def test__hash__shouldReturnDifferentHash__whenUPIDIsDifferent(self):
        # Arrange
        name = anon_string()
        player_a = Player(name, anon_upid())
        player_b = Player(name, anon_upid())

        # Act
        hash_a = hash(player_a)
        hash_b = hash(player_b)

        # Assert
        self.assertNotEqual(hash_a, hash_b)
Example #21
0
    def test__hash__shouldReturnSameHash__whenNameIsSame(self):
        # Arrange
        name = anon_string()
        item_a = Item(name)
        item_b = Item(name)

        # Act
        hash_a = hash(item_a)
        hash_b = hash(item_b)

        # Assert
        self.assertEqual(hash_a, hash_b)
Example #22
0
 def action():
     location.name = anon_string()
Example #23
0
 def action_set():
     Player(anon_string(), set())
Example #24
0
 def action_int():
     Player(anon_string(), 42)
Example #25
0
 def action():
     item.name = anon_string()
Example #26
0
 def action_list():
     Player(anon_string(), [])
Example #27
0
 def action_none():
     Player(anon_string(), None)
Example #28
0
 def action():
     Player(anon_string(), "")