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


C# TestContext.GetMonsterInRank方法代码示例

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


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

示例1: Stalker_ability_switches_adjacent_monsters

        public void Stalker_ability_switches_adjacent_monsters()
        {
            // Arrange
            var context = new TestContext();
            var stalker = context.CreateCard<Bhoidwood>("Bhoidwood Stalker");
            context.SetPlayerHand(stalker);
            context.SetPlayerState(Phase.Dungeon);
            var monster1 = context.GetMonsterInRank(1);
            var monster2 = context.GetMonsterInRank(2);
            context.WhenSelectingCardsSelect(monster1);

            // Act
            context.UseAbilityOf(stalker);

            // Assert
            Assert.That(context.GetMonsterInRank(1), Is.SameAs(monster2));
            Assert.That(context.GetMonsterInRank(2), Is.SameAs(monster1));
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:18,代码来源:BhoidwoodTest.cs

示例2: When_thundermage_bolter_discards_monster

        public void When_thundermage_bolter_discards_monster()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            context.SetPlayerState(Phase.Dungeon);
            var bolter = context.CreateCard<Thundermage>("Thundermage Bolter");
            context.SetPlayerHand(bolter);

            var targetMonster = context.GetMonsterInRank(1);

            var startingXp = player.Xp;
            var startingVp = player.Vp;

            // Act
            context.UseAbilityOf(bolter);

            // Assert
            Assert.That(player.Discard.Contains(targetMonster));
            Assert.That(player.Xp, Is.EqualTo(startingXp), "Using the Thundermage Bolter's ability does not generate XP");
            Assert.That(player.Vp, Is.EqualTo(startingVp + targetMonster.Vp));
            Assert.That(context.GetMonsterInRank(1), Is.Not.Null, "Dungeon hall should be refilled");
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:23,代码来源:ThundermageTest.cs

示例3: When_using_phoenix_trophy

        public void When_using_phoenix_trophy()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            context.SetPlayerState(Phase.Trophy);
            var phoenix = context.CreateCard<BurnmarkedFire>("Phoenix");
            context.SetPlayerHand(phoenix);

            var startingXp = player.Xp;

            // Act
            context.UseAbilityOf(phoenix);
            player.EndTurn();

            // Assert
            Assert.That(player.Xp, Is.EqualTo(startingXp + 3));
            Assert.That(context.GetMonsterInRank(4), Is.SameAs(phoenix));
            Assert.That(phoenix.Owner, Is.EqualTo(CardOwner.Dungeon));
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:20,代码来源:BurnmarkedFireTest.cs

示例4: When_laird_is_defeated_then_correct_monsters_are_discarded

        public void When_laird_is_defeated_then_correct_monsters_are_discarded()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var ambusher = context.CreateCard<KoboldHumanoid>("Drakeclan Ambusher");
            var laird = context.CreateCard<KoboldHumanoid>("Drakeclan Laird");
            var phoenix = context.CreateCard<BurnmarkedFire>("Phoenix");
            var ogre = context.CreateCard<OgreHumanoid>("Ogre");
            context.SetDungeonHall(ambusher, laird, phoenix, ogre);
            var hand = Enumerable.Range(0, 6).Select(x => context.CreateCard<Criochan>("Criochan Captain")).ToArray();
            context.SetPlayerHand(hand);

            // Act
            context.WhenBattling(laird);
            player.DetermineBattleResult();

            // Assert
            var discardedMonsters = player.Discard.Where(c => c.Type == CardType.Monster);
            Assert.That(discardedMonsters, Has.Member(laird));
            Assert.That(discardedMonsters, Has.Member(ambusher));
            Assert.That(context.GetMonsterInRank(1), Is.SameAs(phoenix));
            Assert.That(context.GetMonsterInRank(2), Is.SameAs(ogre));
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:24,代码来源:KoboldHumanoidTest.cs


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