Hi,
I could suggest a few things...
You can divide the testUsersCanDeleteOwnSongsFromParty into three tests (single assertion rule - don't act, assert, act, assert):
- testPartyOwnerDeletesSongAddedByPartyParticipant
- testPartyParticipantCanDeleteOwnSong
- testPartyParticipantCantDeleteSongAddedByAnotherPerson
You don't need assertion message then.
You can also test edge cases, for example try adding the same song twice, remove song from another party, remove song from empty party collection.
I would also use role names, because they are more meaningful than usernames. For instance:
$partyOwner instead of $george
maybe PartyParticipant instead of ApplicationUser
InMemoryPartyStorage or InMemoryPartyRepository instead of Runtime, because database works also at runtime
Read like a sentence is a good rule and you always have to overuse something, when learning, before you get a feel what work's for you and what not.
If your goal is to learn you can try a few different styles and compare results then. For example you can compare readability and performance for:
1. simple representation - overwrite whole party
2. optimized performance - separate party from song collection use cases (maybe some use cases don't need to to access whole collection)
3. auditability - represent party as a stream of events (event sourcing)
Programming is already difficult, so my preference is almost always simplicity (YAGNI and KISS rules), but it's good to verify choices and my favorite way is to build prototype of each solution and compare.
Good luck :-)
You can share if you get some interesting
results of such comparison.