当前位置: 首页>>代码示例>>C#>>正文


C# TestContext.HeroEquipsWeapon方法代码示例

本文整理汇总了C#中NUnit.Framework.TestContext.HeroEquipsWeapon方法的典型用法代码示例。如果您正苦于以下问题:C# TestContext.HeroEquipsWeapon方法的具体用法?C# TestContext.HeroEquipsWeapon怎么用?C# TestContext.HeroEquipsWeapon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NUnit.Framework.TestContext的用法示例。


在下文中一共展示了TestContext.HeroEquipsWeapon方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Bloodrager_can_equip_two_weapons

        public void Bloodrager_can_equip_two_weapons()
        {
            // Arrange
            var context = new TestContext();
            var bloodrager = context.CreateCard<Disowned>("Disowned Bloodrager");
            var weapon1 = context.CreateCard<Pike>();
            var weapon2 = context.CreateCard<SnakeheadFlail>();
            context.SetPlayerHand(bloodrager, weapon1, weapon2);
            context.SetPlayerState(Phase.Dungeon);

            // Act
            context.HeroEquipsWeapon(bloodrager, weapon1);
            context.HeroEquipsWeapon(bloodrager, weapon2);

            // Assert
            Assert.That(bloodrager.IsEquipped, Is.True);
            Assert.That(bloodrager.GetEquipped(), Is.EquivalentTo(new[] {weapon1, weapon2}));
            Assert.That(weapon1.IsEquipped, Is.True);
            Assert.That(weapon2.IsEquipped, Is.True);
            Assert.That(bloodrager.TotalAttack, Is.EqualTo(14));
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:21,代码来源:DisownedTest.cs

示例2: A_hero_armed_with_a_pike_is_immune_to_battle_effects

        public void A_hero_armed_with_a_pike_is_immune_to_battle_effects()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var hero = context.CreateCard<Criochan>();
            var pike = context.CreateCard<Pike>();
            context.SetPlayerHand(hero, pike);
            var ettin = context.SetMonsterInFirstRank<OgreHumanoid>("Ettin");

            // Act
            context.HeroEquipsWeapon(hero, pike);
            context.WhenBattling(ettin);

            // Assert
            Assert.That(player.Hand, Has.Member(hero), "Pike should protect hero from Ettin.");
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:17,代码来源:PikeTest.cs

示例3: When_removing_equipped_weapon_from_hand_then_hero_loses_modifier

        public void When_removing_equipped_weapon_from_hand_then_hero_loses_modifier()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var regular = context.CreateBasicCard<Regular>();
            var spear = context.CreateBasicCard<Longspear>();
            context.SetPlayerHand(regular, spear);
            context.SetPlayerState(Phase.Dungeon, Phase.Equip);
            context.HeroEquipsWeapon(regular, spear);

            // Act
            player.RemoveFromHand(spear);

            // Assert
            Assert.That(regular.PhysicalAttack, Is.EqualTo(1));
            player.View.AssertWasCalled(x => x.Log("Regular no longer has Longspear equipped."));
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:18,代码来源:PlayerTest.cs

示例4: Bloodrager_returns_to_top_of_deck_during_aftermath

        public void Bloodrager_returns_to_top_of_deck_during_aftermath()
        {
            // Arrange
            var context = new TestContext();
            var bloodrager = context.CreateCard<Disowned>("Disowned Bloodrager");
            var weapon = context.CreateCard<Pike>();
            context.SetPlayerHand(bloodrager, weapon);
            context.HeroEquipsWeapon(bloodrager,weapon);
            context.SetPlayerState(Phase.Aftermath);

            // Act
            context.UseAbilityOf(bloodrager);

            // Assert
            Assert.That(context.Player.Hand, Is.EquivalentTo(new[] {weapon}));
            Assert.That(context.Player.Deck.TopCard, Is.SameAs(bloodrager));
            Assert.That(bloodrager.TotalAttack, Is.EqualTo(bloodrager.GetBaseValue(Attr.PhysicalAttack)));
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:18,代码来源:DisownedTest.cs

示例5: Pike_only_protects_the_hero_that_has_it_equipped

        public void Pike_only_protects_the_hero_that_has_it_equipped()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var equippedHero = context.CreateCard<Criochan>();
            var unequippedHero = context.CreateCard<Criochan>();
            var pike = context.CreateCard<Pike>();
            context.SetPlayerHand(equippedHero, pike);
            var ettin = context.SetMonsterInFirstRank<OgreHumanoid>("Ettin");

            // Act
            context.HeroEquipsWeapon(equippedHero, pike);
            context.WhenBattling(ettin);

            // Assert
            Assert.That(player.Hand, Has.Member(equippedHero), "Pike should protect hero from Ettin.");
            Assert.That(player.Hand, Has.No.Member(unequippedHero), "Ettin eats unequipped hero.");
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:19,代码来源:PikeTest.cs

示例6: Pike_does_not_protect_from_non_battle_effects

        public void Pike_does_not_protect_from_non_battle_effects()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var hero = context.CreateBasicCard<Regular>();
            var pike = context.CreateCard<Pike>();
            context.SetPlayerHand(hero, pike);
            var ogre = context.SetMonsterInFirstRank<OgreHumanoid>("Ogre");

            // Act
            context.HeroEquipsWeapon(hero, pike);
            context.SetPlayerState(Phase.Aftermath);
            player.OnSelectMonster(ogre);
            context.UseAbilityOf(ogre);

            // Assert
            Assert.That(player.Hand, Has.No.Member(hero), "Pike should not protect hero from Ogre.");
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:19,代码来源:PikeTest.cs


注:本文中的NUnit.Framework.TestContext.HeroEquipsWeapon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。