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


C# TestContext.DrawHeroFromTopOfDeck方法代码示例

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


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

示例1: Necrophidius_trophy_ability

        public void Necrophidius_trophy_ability()
        {
            // Arrange
            var context = new TestContext();
            var necrophidius = context.CreateCard<UndeadSkeleton>("Necrophidius");
            var hero0 = context.DrawHeroFromTopOfDeck(x => x.Level == 0);
            var hero1 = context.DrawHeroFromTopOfDeck(x => x.Level == 1);
            var hero2 = context.GetHeroFromVillage(x => x.Level == 2);
            context.SetPlayerHand(necrophidius, hero0, hero1, hero2);
            context.SetPlayerState(Phase.Trophy);

            // Act
            context.UseAbilityOf(necrophidius);

            // Assert
            Assert.That(context.SelectCardsIds, Is.EquivalentTo(new[] {hero0.Id, hero1.Id}));
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:17,代码来源:UndeadSkeletonTest.cs

示例2: Polisher_can_use_ability_multiple_times

        public void Polisher_can_use_ability_multiple_times()
        {
            // Arrange
            var context = new TestContext();
            context.SetPlayerState(Phase.Dungeon);
            var polisher = context.CreateCard<Whetmage>("Whetmage Polisher");
            var hero1 = context.DrawHeroFromTopOfDeck(x=>x.Level==1);
            var hero2 = context.DrawHeroFromTopOfDeck(x => x.Level == 1);
            context.SetPlayerHand(polisher, hero1, hero2);
            context.Player.Xp = 10;
            var levelUp = polisher.GetAbility();

            // Act
            context.UseAbilityOf(polisher);

            // Assert
            Assert.That(context.Player.ActiveAbilities.Any(x=>x.Id == levelUp.Id));
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:18,代码来源:WhetmageTest.cs

示例3: When_whetmage_levels_other_hero_then_curse_of_decay_ability_is_no_longer_available

        public void When_whetmage_levels_other_hero_then_curse_of_decay_ability_is_no_longer_available()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var curse = context.CreateCard<CurseOfDecay>();
            var whetmage = context.CreateCard<Whetmage>();
            var hero1 = context.DrawHeroFromTopOfDeck(x => x.Level == 1);
            var hero2 = context.DrawHeroFromTopOfDeck(x => x.Level == 1);
            context.SetPlayerHand(curse, whetmage, hero1, hero2);
            context.SetPlayerState(Phase.Dungeon);
            player.Xp = 2;

            var levelOtherHero = whetmage.GetAbilities().First();
            var curseAbility = curse.GetAbilities().First();

            // Act
            context.UseAbilityOf(whetmage);

            // Assert
            Assert.That(player.ActiveAbilities, Has.No.Member(curseAbility));
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:22,代码来源:CurseOfDecayTest.cs

示例4: Ossuous_can_be_attacked_if_hero_of_at_least_level_1_is_present

        public void Ossuous_can_be_attacked_if_hero_of_at_least_level_1_is_present()
        {
            // Arrange
            var context = new TestContext();
            var hero = context.DrawHeroFromTopOfDeck(x => x.Level == 1);
            context.SetPlayerHand(hero);
            var ossuous = context.SetMonsterInFirstRank<UndeadSkeleton>("Ossuous");

            // Act
            Assert.That(context.Game.Dungeon.Ranks[0].Card, Is.SameAs(ossuous));
            context.Player.SelectMonster();

            // Assert
            Assert.That(context.SelectCardsIds, Has.Member(ossuous.Id), "Valid targets should contain Ossuous");
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:15,代码来源:UndeadSkeletonTest.cs

示例5: Polisher_cannot_use_ability_to_level_up_card_it_already_leveled_up

        public void Polisher_cannot_use_ability_to_level_up_card_it_already_leveled_up()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            player.State = PlayerState.Dungeon;
            var polisher = context.CreateCard<Whetmage>("Whetmage Polisher");
            var hero = context.DrawHeroFromTopOfDeck(x => x.Level == 1);
            context.SetPlayerHand(polisher, hero);
            player.Xp = 10;
            var levelUp = polisher.GetAbility();

            // Act
            context.UseAbility(levelUp);

            // Assert
            Assert.That(levelUp.Condition(player), Is.False);
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:18,代码来源:WhetmageTest.cs

示例6: Level_up_other_hero

        public void Level_up_other_hero()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            context.SetPlayerState(Phase.Dungeon);
            var honer = context.CreateCard<Whetmage>();
            var otherHero = context.DrawHeroFromTopOfDeck(c => c.Level > 0);
            context.SetPlayerHand(honer, otherHero);
            player.Xp = 2;

            // Act
            context.UseAbilityOf(honer);

            // Assert
            Assert.That(player.Hand.Count, Is.EqualTo(2));
            Assert.That(player.Hand.Contains(otherHero), Is.False);
            Assert.That(player.Hand.Single(c=>c != honer).Level, Is.EqualTo(2));
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:19,代码来源:WhetmageTest.cs


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