本文整理汇总了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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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}));
}
示例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));
}
示例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}));
}
示例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));
}
示例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}));
}
示例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);
}
示例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);
}
示例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));
}
示例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));
}