本文整理汇总了C#中NUnit.Framework.TestContext.DrawHeroFromTopOfDeck方法的典型用法代码示例。如果您正苦于以下问题:C# TestContext.DrawHeroFromTopOfDeck方法的具体用法?C# TestContext.DrawHeroFromTopOfDeck怎么用?C# TestContext.DrawHeroFromTopOfDeck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NUnit.Framework.TestContext
的用法示例。
在下文中一共展示了TestContext.DrawHeroFromTopOfDeck方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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}));
}
示例2: Polisher_can_use_ability_multiple_times
public void Polisher_can_use_ability_multiple_times()
{
// Arrange
var context = new TestContext();
context.SetPlayerState(Phase.Dungeon);
var polisher = context.CreateCard<Whetmage>("Whetmage Polisher");
var hero1 = context.DrawHeroFromTopOfDeck(x=>x.Level==1);
var hero2 = context.DrawHeroFromTopOfDeck(x => x.Level == 1);
context.SetPlayerHand(polisher, hero1, hero2);
context.Player.Xp = 10;
var levelUp = polisher.GetAbility();
// Act
context.UseAbilityOf(polisher);
// Assert
Assert.That(context.Player.ActiveAbilities.Any(x=>x.Id == levelUp.Id));
}
示例3: When_whetmage_levels_other_hero_then_curse_of_decay_ability_is_no_longer_available
public void When_whetmage_levels_other_hero_then_curse_of_decay_ability_is_no_longer_available()
{
// Arrange
var context = new TestContext();
var player = context.Player;
var curse = context.CreateCard<CurseOfDecay>();
var whetmage = context.CreateCard<Whetmage>();
var hero1 = context.DrawHeroFromTopOfDeck(x => x.Level == 1);
var hero2 = context.DrawHeroFromTopOfDeck(x => x.Level == 1);
context.SetPlayerHand(curse, whetmage, hero1, hero2);
context.SetPlayerState(Phase.Dungeon);
player.Xp = 2;
var levelOtherHero = whetmage.GetAbilities().First();
var curseAbility = curse.GetAbilities().First();
// Act
context.UseAbilityOf(whetmage);
// Assert
Assert.That(player.ActiveAbilities, Has.No.Member(curseAbility));
}
示例4: Ossuous_can_be_attacked_if_hero_of_at_least_level_1_is_present
public void Ossuous_can_be_attacked_if_hero_of_at_least_level_1_is_present()
{
// Arrange
var context = new TestContext();
var hero = context.DrawHeroFromTopOfDeck(x => x.Level == 1);
context.SetPlayerHand(hero);
var ossuous = context.SetMonsterInFirstRank<UndeadSkeleton>("Ossuous");
// Act
Assert.That(context.Game.Dungeon.Ranks[0].Card, Is.SameAs(ossuous));
context.Player.SelectMonster();
// Assert
Assert.That(context.SelectCardsIds, Has.Member(ossuous.Id), "Valid targets should contain Ossuous");
}
示例5: Polisher_cannot_use_ability_to_level_up_card_it_already_leveled_up
public void Polisher_cannot_use_ability_to_level_up_card_it_already_leveled_up()
{
// Arrange
var context = new TestContext();
var player = context.Player;
player.State = PlayerState.Dungeon;
var polisher = context.CreateCard<Whetmage>("Whetmage Polisher");
var hero = context.DrawHeroFromTopOfDeck(x => x.Level == 1);
context.SetPlayerHand(polisher, hero);
player.Xp = 10;
var levelUp = polisher.GetAbility();
// Act
context.UseAbility(levelUp);
// Assert
Assert.That(levelUp.Condition(player), Is.False);
}
示例6: Level_up_other_hero
public void Level_up_other_hero()
{
// Arrange
var context = new TestContext();
var player = context.Player;
context.SetPlayerState(Phase.Dungeon);
var honer = context.CreateCard<Whetmage>();
var otherHero = context.DrawHeroFromTopOfDeck(c => c.Level > 0);
context.SetPlayerHand(honer, otherHero);
player.Xp = 2;
// Act
context.UseAbilityOf(honer);
// Assert
Assert.That(player.Hand.Count, Is.EqualTo(2));
Assert.That(player.Hand.Contains(otherHero), Is.False);
Assert.That(player.Hand.Single(c=>c != honer).Level, Is.EqualTo(2));
}