Exemple #1
0
        public void throw_exception_if_player_not_found()
        {
            var cmd = new SetSoulbindingConsent {
                PlayerId = -123, IsConsenting = true
            };

            Assert.That(() => Repository.Execute(cmd),
                        Throws.TypeOf <DomainException>().With.Message.EqualTo("Player with ID '-123' not found."));
        }
Exemple #2
0
        public void throw_exception_if_player_item_not_found()
        {
            player = new PlayerBuilder()
                     .With(p => p.Id, 345)
                     .With(p => p.Location, "underworld")
                     .With(p => p.Mobility, PvPStatics.MobilityFull)
                     .With(p => p.Mobility, PvPStatics.MobilityInanimate)
                     .With(p => p.Item, null)
                     .BuildAndSave();

            var cmd = new SetSoulbindingConsent {
                PlayerId = player.Id, IsConsenting = true
            };

            Assert.That(() => Repository.Execute(cmd),
                        Throws.TypeOf <DomainException>().With.Message.EqualTo("You are not inanimate or a pet."));
        }