public void should_throw_exception_if_player_not_animate() { var cmd = new RetrieveSoulboundItems { PlayerId = inanimatePlayer.Id }; Assert.That(() => Repository.Execute(cmd), Throws.TypeOf <DomainException>().With.Message.EqualTo("You must be animate in order to do this.")); }
public void should_throw_exception_if_player_not_found() { var cmd = new RetrieveSoulboundItems { PlayerId = -99 }; Assert.That(() => Repository.Execute(cmd), Throws.TypeOf <DomainException>().With.Message.EqualTo("player with ID '-99' could not be found")); }
public void should_throw_exception_if_wrong_location() { player = new PlayerBuilder() .With(p => p.Id, 505) .With(p => p.Location, "elsewhere") .BuildAndSave(); var cmd = new RetrieveSoulboundItems { PlayerId = player.Id }; Assert.That(() => Repository.Execute(cmd), Throws.TypeOf <DomainException>().With.Message .EqualTo("You must be in the same location as John Doe to retrieve your soulbound items.")); }