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


C# TestContext.UseAbilityOf方法代碼示例

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


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

示例1: Using_ability_destroys_curse

        public void Using_ability_destroys_curse()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var curse = context.CreateCard<CurseOfSloth>();
            context.SetPlayerHand(curse);
            context.SetPlayerState(Phase.Dungeon);

            // Act
            context.UseAbilityOf(curse);

            // Assert
            Assert.That(player.Hand, Has.No.Member(curse));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:15,代碼來源:CurseOfSlothTest.cs

示例2: Using_ability_disables_abilities

        public void Using_ability_disables_abilities(Phase phase, bool isActive)
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var curse = context.CreateCard<CurseOfSloth>();
            context.SetPlayerHand(curse);
            var otherAbility = context.AddAbilityStub(phase);
            context.SetPlayerState(Phase.Dungeon);

            // Act
            context.UseAbilityOf(curse);

            // Assert
            Assert.That(player.ActiveAbilities.Contains(otherAbility), Is.EqualTo(isActive));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:16,代碼來源:CurseOfSlothTest.cs

示例3: Using_ability_destroys_curse

        public void Using_ability_destroys_curse()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var curse = context.CreateCard<CurseOfNeglect>();
            var longspear = context.CreateBasicCard<Longspear>();
            context.SetPlayerHand(curse, longspear);
            context.SetPlayerState(Phase.Village);

            // Act
            context.UseAbilityOf(curse);

            // Assert
            Assert.That(player.Hand, Has.No.Member(curse));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:16,代碼來源:CurseOfNeglectTest.cs

示例4: Using_ability_reduces_number_of_cards_drawn

        public void Using_ability_reduces_number_of_cards_drawn()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var curse = context.CreateCard<CurseOfShame>();
            context.SetPlayerHand(curse);
            context.SetPlayerState(Phase.Village);

            // Act
            context.UseAbilityOf(curse);
            context.Player.EndTurn();

            // Assert
            Assert.That(player.Hand.Count, Is.EqualTo(4));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:16,代碼來源:CurseOfShameTest.cs

示例5: Using_ability_reduces_player_light_to_zero

        public void Using_ability_reduces_player_light_to_zero()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var curse = context.CreateCard<CurseOfHorror>();
            var torch = context.CreateBasicCard<Torch>();
            context.SetPlayerHand(curse, torch);
            context.SetPlayerState(Phase.Dungeon);

            // Act
            context.UseAbilityOf(curse);

            // Assert
            Assert.That(player.TotalLight, Is.EqualTo(0));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:16,代碼來源:CurseOfHorrorTest.cs

示例6: Using_ability_reduces_available_gold_by_2

        public void Using_ability_reduces_available_gold_by_2()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var curse = context.CreateCard<CurseOfNeglect>();
            var longspear = context.CreateBasicCard<Longspear>();
            context.SetPlayerHand(curse, longspear);
            context.SetPlayerState(Phase.Village);

            // Act
            context.UseAbilityOf(curse);

            // Assert
            Assert.That(player.AvailableGold, Is.EqualTo(0));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:16,代碼來源:CurseOfNeglectTest.cs

示例7: Beserker_destroys_other_hero_during_aftermath

        public void Beserker_destroys_other_hero_during_aftermath()
        {
            // Arrange
            var context = new TestContext();
            var berserker = context.CreateCard<Disowned>("Disowned Berserker");
            var otherHero = context.CreateBasicCard<Regular>();
            var weapon = context.CreateCard<Pike>();
            context.SetPlayerHand(berserker, otherHero, weapon);
            context.SetPlayerState(Phase.Aftermath);

            // Act
            context.UseAbilityOf(berserker);

            // Assert
            Assert.That(context.Player.Hand, Is.EquivalentTo(new[]{berserker, weapon}));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:16,代碼來源:DisownedTest.cs

示例8: Using_ability_destroys_curse_and_reduces_xp_by_2

        public void Using_ability_destroys_curse_and_reduces_xp_by_2()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var curse = context.CreateCard<CurseOfHostility>();
            context.SetPlayerHand(curse);
            context.SetPlayerState(Phase.Dungeon);
            player.Xp = 2;

            // Act
            context.UseAbilityOf(curse);

            // Assert
            Assert.That(player.Hand, Has.No.Member(curse));
            Assert.That(player.Xp, Is.EqualTo(0));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:17,代碼來源:CurseOfHostilityTest.cs

示例9: Using_ability_reduces_total_attack_value_by_3

        public void Using_ability_reduces_total_attack_value_by_3()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var curse = context.CreateCard<CurseOfSloth>();
            var sergeant = context.CreateCard<Criochan>();
            var summoner = context.CreateCard<Thundermage>();
            context.SetPlayerHand(curse, sergeant, summoner);
            context.SetPlayerState(Phase.Dungeon);

            // Act
            context.UseAbilityOf(curse);

            // Assert
            Assert.That(player.TotalAttack, Is.EqualTo(sergeant.TotalAttack + summoner.TotalAttack - 3));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:17,代碼來源:CurseOfSlothTest.cs

示例10: 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

示例11: Curse_of_discord_cannot_discard_itself

        public void Curse_of_discord_cannot_discard_itself()
        {
            // Arrange
            var context = new TestContext();
            context.Player.State = PlayerState.Village;
            var curse = context.CreateCard<CurseOfDiscord>();
            var regular = context.CreateBasicCard<Regular>();
            var torch = context.CreateBasicCard<Torch>();
            var longspear = context.CreateBasicCard<Longspear>();
            context.SetPlayerHand(curse, regular, torch, longspear);

            // Act
            context.UseAbilityOf(curse);

            // Assert
            Assert.That(context.SelectCardsIds, Has.No.Member(curse.Id));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:17,代碼來源:CurseOfDiscordTest.cs

示例12: Bloodrager_destroys_all_other_heroes_during_aftermath

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

            // Act
            context.UseAbilityOf(bloodrager);

            // Assert
            Assert.That(context.Player.Hand, Is.EquivalentTo(new[] {weapon}));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:17,代碼來源:DisownedTest.cs

示例13: Using_ability_destroys_one_random_card

        public void Using_ability_destroys_one_random_card()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var curse = context.CreateCard<CurseOfWar>();
            var card1 = context.CreateBasicCard<Torch>();
            var card2 = context.CreateBasicCard<Regular>();
            context.SetPlayerHand(curse, card1, card2);
            context.SetPlayerState(Phase.Village);
            context.WhenSelectingCardsSelectFirst();

            // Act
            context.UseAbilityOf(curse);

            // Assert
            Assert.That(player.Hand.Count, Is.EqualTo(1));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:18,代碼來源:CurseOfWarTest.cs

示例14: Using_ability_destroys_curse

        public void Using_ability_destroys_curse(Phase phase)
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var curse = context.CreateCard<CurseOfWar>();
            var card1 = context.CreateBasicCard<Torch>();
            var card2 = context.CreateBasicCard<Regular>();
            context.SetPlayerHand(curse, card1, card2);
            context.SetPlayerState(phase);
            context.WhenSelectingCardsSelectFirst();

            // Act
            context.UseAbilityOf(curse);

            // Assert
            Assert.That(player.Hand, Has.No.Member(curse));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:18,代碼來源:CurseOfWarTest.cs

示例15: 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


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