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)
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)
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)
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)
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)
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)
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)
def test__str__shouldReturnStringForm(self): # Arrange expected_name = anon_string() item = Item(expected_name) # Act actual = str(item) # Assert self.assertEqual(expected_name, actual)
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)
def test__str__shouldReturnLocationName(self): # Arrange expected_name = anon_string() location = Location(expected_name) # Act actual = str(location) # Assert self.assertEquals(expected_name, actual)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
def action(): location.name = anon_string()
def action_set(): Player(anon_string(), set())
def action_int(): Player(anon_string(), 42)
def action(): item.name = anon_string()
def action_list(): Player(anon_string(), [])
def action_none(): Player(anon_string(), None)
def action(): Player(anon_string(), "")