本文整理汇总了C#中NUnit.Framework.TestContext.CreateBasicCard方法的典型用法代码示例。如果您正苦于以下问题:C# TestContext.CreateBasicCard方法的具体用法?C# TestContext.CreateBasicCard怎么用?C# TestContext.CreateBasicCard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NUnit.Framework.TestContext
的用法示例。
在下文中一共展示了TestContext.CreateBasicCard方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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}));
}
示例2: 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));
}
示例3: 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));
}
示例4: 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));
}
示例5: When_removing_equipped_weapon_from_hand_then_hero_loses_modifier
public void When_removing_equipped_weapon_from_hand_then_hero_loses_modifier()
{
// Arrange
var context = new TestContext();
var player = context.Player;
var regular = context.CreateBasicCard<Regular>();
var spear = context.CreateBasicCard<Longspear>();
context.SetPlayerHand(regular, spear);
context.SetPlayerState(Phase.Dungeon, Phase.Equip);
context.HeroEquipsWeapon(regular, spear);
// Act
player.RemoveFromHand(spear);
// Assert
Assert.That(regular.PhysicalAttack, Is.EqualTo(1));
player.View.AssertWasCalled(x => x.Log("Regular no longer has Longspear equipped."));
}
示例6: When_equipping_a_weapon_then_curse_of_decay_ability_is_still_available
public void When_equipping_a_weapon_then_curse_of_decay_ability_is_still_available()
{
// Arrange
var context = new TestContext();
var player = context.Player;
var curse = context.CreateCard<CurseOfDecay>();
var regular = context.CreateBasicCard<Regular>();
var longspear = context.CreateBasicCard<Longspear>();
context.SetPlayerHand(curse, regular, longspear);
player.State = PlayerState.Dungeon;
var equipLongspear = longspear.GetAbilities().First();
var curseAbility = curse.GetAbilities().First();
// Act
context.UseAbility(equipLongspear);
// Assert
Assert.That(player.ActiveAbilities, Has.Member(curseAbility));
}
示例7: 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);
}
示例8: 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));
}
示例9: 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));
}
示例10: 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));
}
示例11: Using_ability_destroys_curse
public void Using_ability_destroys_curse()
{
// 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.Hand, Has.No.Member(curse));
}
示例12: 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}));
}
示例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: Terror_can_destroy_card
public void Terror_can_destroy_card()
{
// Arrange
var context = new TestContext();
var terror = context.CreateCard<Skinshifter>("Terror");
var otherCard = context.CreateBasicCard<Torch>();
context.SetPlayerHand(terror, otherCard);
context.SetPlayerState(Phase.Dungeon);
context.WhenSelectingOptionSelect("Destroy");
// Act
context.UseAbilityOf(terror);
// Assert
Assert.That(terror.PhysicalAttack, Is.EqualTo(8));
Assert.That(terror.Strength, Is.EqualTo(8));
Assert.That(context.Player.Hand, Has.No.Member(otherCard));
Assert.That(context.Player.Discard, Has.No.Member(otherCard));
}
示例15: Pike_does_not_protect_from_non_battle_effects
public void Pike_does_not_protect_from_non_battle_effects()
{
// Arrange
var context = new TestContext();
var player = context.Player;
var hero = context.CreateBasicCard<Regular>();
var pike = context.CreateCard<Pike>();
context.SetPlayerHand(hero, pike);
var ogre = context.SetMonsterInFirstRank<OgreHumanoid>("Ogre");
// Act
context.HeroEquipsWeapon(hero, pike);
context.SetPlayerState(Phase.Aftermath);
player.OnSelectMonster(ogre);
context.UseAbilityOf(ogre);
// Assert
Assert.That(player.Hand, Has.No.Member(hero), "Pike should not protect hero from Ogre.");
}