本文整理汇总了C#中NUnit.Framework.TestContext.SetPlayerHand方法的典型用法代码示例。如果您正苦于以下问题:C# TestContext.SetPlayerHand方法的具体用法?C# TestContext.SetPlayerHand怎么用?C# TestContext.SetPlayerHand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NUnit.Framework.TestContext
的用法示例。
在下文中一共展示了TestContext.SetPlayerHand方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: When_laird_is_defeated_then_all_kobolds_in_hall_are_defeated
public void When_laird_is_defeated_then_all_kobolds_in_hall_are_defeated()
{
// Arrange
var context = new TestContext();
var player = context.Player;
var laird = context.CreateCard<KoboldHumanoid>("Drakeclan Laird");
var ambusher = context.CreateCard<KoboldHumanoid>("Drakeclan Ambusher");
var cutter = context.CreateCard<KoboldHumanoid>("Drakeclan Cutter");
var shaman = context.CreateCard<KoboldHumanoid>("Drakeclan Shaman");
var kobolds = new[] {laird, ambusher, cutter, shaman};
context.SetTopOfDungeonDeck(kobolds);
context.AdvanceMonsterToFirstRank(laird);
var hand = Enumerable.Range(0, 6).Select(x => context.CreateCard<Criochan>("Criochan Captain")).ToArray();
context.SetPlayerHand(hand);
var startingXp = player.Xp;
var startingVp = player.Vp;
// Act
context.WhenBattling(laird);
player.DetermineBattleResult();
// Assert
kobolds.Each(x => Assert.That(player.Discard.Contains(x), "Discard does not contain {0}".Template(x.Name)));
context.Game.Dungeon.Ranks.Each(r=> Assert.That(r.Card, Is.Not.Null, "Rank {0} is empty".Template(r.Number)));
kobolds.Each(x => Assert.That(context.Game.Dungeon.Ranks.All(rank => rank.Card != x)));
Assert.That(player.Xp, Is.EqualTo(startingXp + laird.Xp));
Assert.That(player.Vp, Is.EqualTo(startingVp + kobolds.Sum(x => x.Vp)));
}
示例2: The_flail_has_no_potential_attack_if_no_heroes_in_hand
public void The_flail_has_no_potential_attack_if_no_heroes_in_hand()
{
// Arrange
var context = new TestContext();
var player = context.Player;
var flail = context.CreateCard<SnakeheadFlail>();
context.SetPlayerHand(flail);
// Act
var potential = flail.PotentialPhysicalAttack;
// Assert
Assert.That(potential, Is.Null);
}
示例3: Must_be_at_least_2_other_cards_to_use_ability
public void Must_be_at_least_2_other_cards_to_use_ability()
{
// Arrange
var context = new TestContext();
var curse = context.CreateCard<CurseOfDiscord>();
var regular = context.CreateBasicCard<Regular>();
context.SetPlayerHand(curse, regular);
// Act
var usable = curse.GetAbilities().First().Condition(context.Player);
// Assert
Assert.That(usable, Is.False);
}
示例4: 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));
}
示例5: 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");
}
示例6: When_curse_is_in_hand_then_cant_prepare_or_rest
public void When_curse_is_in_hand_then_cant_prepare_or_rest()
{
// Arrange
var context = new TestContext();
var player = context.Player;
var curse = context.CreateCard<CurseOfWar>();
context.SetPlayerHand(curse);
// Act
player.StartTurn();
// Assert
var message = context.Get<StartTurnMessage>();
Assert.That(message.AvailableActions, Is.EquivalentTo(new[]{"Village", "Dungeon"}));
}
示例7: 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));
}
示例8: 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));
}
示例9: A_hero_not_armed_with_a_pike_is_not_immune_to_battle_effects
public void A_hero_not_armed_with_a_pike_is_not_immune_to_battle_effects()
{
// Arrange
var context = new TestContext();
var player = context.Player;
var hero = context.CreateCard<Criochan>();
var pike = context.CreateCard<Pike>();
context.SetPlayerHand(hero, pike);
var ettin = context.SetMonsterInFirstRank<OgreHumanoid>("Ettin");
// Act
context.WhenBattling(ettin);
// Assert
Assert.That(player.Hand, Has.No.Member(hero), "Ettin eats hero.");
}
示例10: 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}));
}
示例11: 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));
}
示例12: 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));
}
示例13: 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));
}
示例14: 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}));
}
示例15: 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));
}