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