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


C# TestContext.SetPlayerState方法代码示例

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


在下文中一共展示了TestContext.SetPlayerState方法的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: 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

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

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

示例12: Hand_must_contain_another_hero

        public void Hand_must_contain_another_hero()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var honer = context.CreateCard<Whetmage>("Whetmage Honer");
            context.SetPlayerHand(honer);
            player.Xp = 2;
            context.SetPlayerState(Phase.Dungeon);
            var ability = context.GetAbilityOf(honer);

            // Act
            var isUsable = context.IsAbilityUsable(ability);

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

示例13: Hand_must_have_at_least_3_cards_in_order_to_use_ability

        public void Hand_must_have_at_least_3_cards_in_order_to_use_ability()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var curse = context.CreateCard<CurseOfWar>();
            var card1 = context.CreateBasicCard<Torch>();
            context.SetPlayerHand(curse, card1);
            context.SetPlayerState(Phase.Dungeon);
            var ability = context.GetAbilityOf(curse);

            // Act
            var canUse = ability.Condition(player);

            // Assert
            Assert.That(canUse, Is.False);
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:17,代码来源:CurseOfWarTest.cs

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

示例15: Looter_spoils_ability_buys_card_and_puts_on_top_of_deck

        public void Looter_spoils_ability_buys_card_and_puts_on_top_of_deck()
        {
            // Arrange
            var context = new TestContext();
            var player = context.Player;
            var looter = context.CreateCard<Rapparee>("Rapparee Looter");
            context.SetPlayerHand(looter);
            context.SetPlayerState(Phase.Spoils);
            var longspear = context.GetVillageDeck(CardType.Weapon, card => card.Name == "Longspear").TopCard;
            context.WhenSelectingCardsSelect(longspear);

            // Act
            context.UseAbilityOf(looter);

            // Assert
            Assert.That(player.Deck.TopCard, Is.SameAs(longspear));
            Assert.That(player.Discard, Has.No.Member(longspear));
        }
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:18,代码来源:RappareeTest.cs


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