Example #1
0
        public void DrinkAlcoholFail()
        {
            var consumeHandler = new AlcoholConsumeHandler();
            var player         = this.GetPlayer();
            var success        = consumeHandler.ConsumeItem(player, 12, 0);

            Assert.That(success, Is.False);
            Mock.Get(player.PlayerView).Verify(view => view.DrinkAlcohol(), Times.Never);
        }
Example #2
0
        public void DrinkAlcoholFail()
        {
            var consumeHandler = new AlcoholConsumeHandler();
            var player         = this.GetPlayer();
            var success        = consumeHandler.ConsumeItem(player, null, null, FruitUsage.Undefined);

            Assert.That(success, Is.False);
            Mock.Get(player.ViewPlugIns.GetPlugIn <IDrinkAlcoholPlugIn>()).Verify(view => view.DrinkAlcohol(), Times.Never);
        }
Example #3
0
        public void DrinkAlcoholFail()
        {
            var consumeHandler = new AlcoholConsumeHandler();
            var player         = this.GetPlayer();

            player.PlayerView.Expect(view => view.DrinkAlcohol()).Repeat.Never();
            var success = consumeHandler.ConsumeItem(player, 12, 0);

            Assert.That(success, Is.False);
            player.PlayerView.VerifyAllExpectations();
        }
Example #4
0
        public void DrinkAlcoholSuccess()
        {
            var consumeHandler = new AlcoholConsumeHandler();
            var player         = this.GetPlayer();
            var item           = this.GetItem();

            player.Inventory.AddItem(ItemSlot, item);
            var success = consumeHandler.ConsumeItem(player, ItemSlot, 0);

            Assert.That(success, Is.True);
            Assert.That(player.Inventory.Items.Any(), Is.False);
            Mock.Get(player.PlayerView).Verify(view => view.DrinkAlcohol(), Times.Once);
        }
Example #5
0
        public void DrinkAlcoholSuccess()
        {
            var consumeHandler = new AlcoholConsumeHandler();
            var player         = this.GetPlayer();
            var item           = this.GetItem();

            player.Inventory !.AddItem(ItemSlot, item);
            var success = consumeHandler.ConsumeItem(player, item, null, FruitUsage.Undefined);

            Assert.That(success, Is.True);
            Assert.That(player.Inventory.Items.Any(), Is.False);
            Mock.Get(player.ViewPlugIns.GetPlugIn <IDrinkAlcoholPlugIn>()).Verify(view => view !.DrinkAlcohol(), Times.Once);
        }
Example #6
0
        public void DrinkAlcoholSuccess()
        {
            var consumeHandler = new AlcoholConsumeHandler();
            var player         = this.GetPlayer();
            var item           = this.GetItem();

            player.Inventory.AddItem(ItemSlot, item);
            player.PlayerView.Expect(view => view.DrinkAlcohol()).Repeat.Once();
            var success = consumeHandler.ConsumeItem(player, ItemSlot, 0);

            Assert.That(success, Is.True);
            Assert.That(player.Inventory.Items.Any(), Is.False);
            player.PlayerView.VerifyAllExpectations();
        }