當前位置: 首頁>>代碼示例>>C#>>正文


C# TestContext.AdvanceMonsterToFirstRank方法代碼示例

本文整理匯總了C#中NUnit.Framework.TestContext.AdvanceMonsterToFirstRank方法的典型用法代碼示例。如果您正苦於以下問題:C# TestContext.AdvanceMonsterToFirstRank方法的具體用法?C# TestContext.AdvanceMonsterToFirstRank怎麽用?C# TestContext.AdvanceMonsterToFirstRank使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NUnit.Framework.TestContext的用法示例。


在下文中一共展示了TestContext.AdvanceMonsterToFirstRank方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: When_laird_is_defeated_then_all_kobolds_in_hall_are_defeated

        public void When_laird_is_defeated_then_all_kobolds_in_hall_are_defeated()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var laird = context.CreateCard<KoboldHumanoid>("Drakeclan Laird");
            var ambusher = context.CreateCard<KoboldHumanoid>("Drakeclan Ambusher");
            var cutter = context.CreateCard<KoboldHumanoid>("Drakeclan Cutter");
            var shaman = context.CreateCard<KoboldHumanoid>("Drakeclan Shaman");
            var kobolds = new[] {laird, ambusher, cutter, shaman};
            context.SetTopOfDungeonDeck(kobolds);
            context.AdvanceMonsterToFirstRank(laird);
            var hand = Enumerable.Range(0, 6).Select(x => context.CreateCard<Criochan>("Criochan Captain")).ToArray();
            context.SetPlayerHand(hand);
            var startingXp = player.Xp;
            var startingVp = player.Vp;

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

            // Assert
            kobolds.Each(x => Assert.That(player.Discard.Contains(x), "Discard does not contain {0}".Template(x.Name)));
            context.Game.Dungeon.Ranks.Each(r=> Assert.That(r.Card, Is.Not.Null, "Rank {0} is empty".Template(r.Number)));
            kobolds.Each(x => Assert.That(context.Game.Dungeon.Ranks.All(rank => rank.Card != x)));
            Assert.That(player.Xp, Is.EqualTo(startingXp + laird.Xp));
            Assert.That(player.Vp, Is.EqualTo(startingVp + kobolds.Sum(x => x.Vp)));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:28,代碼來源:KoboldHumanoidTest.cs

示例2: Laird_gains_health_equal_to_other_kobolds_in_hall

        public void Laird_gains_health_equal_to_other_kobolds_in_hall()
        {
            // Arrange
            var context = new TestContext();
            var laird = context.CreateCard<KoboldHumanoid>("Drakeclan Laird");
            var ambusher = context.CreateCard<KoboldHumanoid>("Drakeclan Ambusher");
            var cutter = context.CreateCard<KoboldHumanoid>("Drakeclan Cutter");
            var shaman = context.CreateCard<KoboldHumanoid>("Drakeclan Shaman");
            context.SetTopOfDungeonDeck(laird, ambusher, cutter, shaman);

            // Act
            context.AdvanceMonsterToFirstRank(laird);

            // Assert
            Assert.That(laird.Health, Is.EqualTo(laird.GetBaseValue(Attr.Health) + ambusher.Health + cutter.Health + shaman.Health));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:16,代碼來源:KoboldHumanoidTest.cs


注:本文中的NUnit.Framework.TestContext.AdvanceMonsterToFirstRank方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。