public void GetPCTargetsTest_SELF() { //arrange AbstractPlayer PC = new DEBUG_PC(); AbstractPlayer Monster = new DEBUG_Monster(); AbstractPlayer Environment = new DEBUG_Environment(); AbstractCard tmp_card = new DEBUG_Card("TEST", AbstractCard.CardRarity.Common, AbstractCard.CardType.Attack, AbstractCard.CardTarget.Self, 1, "TEST"); List <AbstractPlayer> expected_list = new List <AbstractPlayer> { PC }; bool expected_equal = true; //act List <AbstractPlayer> result_list = CardTargettingUtility.GetPCTargets(tmp_card, PC, Monster, (AbstractEnvironment)Environment); bool actual_equal = true; for (int i = 0; i < result_list.Count; i++) { if (!expected_list.Contains(result_list[i])) { actual_equal = false; } } for (int i = 0; i < expected_list.Count; i++) { if (!result_list.Contains(expected_list[i])) { actual_equal = false; } } //assert Assert.AreEqual(expected_equal, actual_equal); }
public void IsValidCardIDTest_InvalidString() { //arrange AbstractCard test_card = new DEBUG_Card("ThisIsACardNameWow", AbstractCard.CardRarity.Common, AbstractCard.CardType.Attack, AbstractCard.CardTarget.All, 2, "DEBUG_CARD"); bool expected_result = false; //act bool actual_result = CardIDUtilities.IsValidCardID(test_card); //assert Assert.AreEqual(actual_result, expected_result); }
public void GetCardFactionTest_Invalid() { //arrange AbstractCard test_card = new DEBUG_Card("ThisIsACardNameWow", AbstractCard.CardRarity.Common, AbstractCard.CardType.Attack, AbstractCard.CardTarget.All, 2, "DEBUG_CARD"); string expected_result = ""; //act string actual_result = CardIDUtilities.GetCardFaction(test_card); //assert Assert.AreEqual(actual_result, expected_result); }
public void GetPCTargetsTest_Empty() { //arrange AbstractPlayer PC = new DEBUG_PC(); AbstractPlayer Monster = new DEBUG_Monster(); AbstractPlayer Environment = new DEBUG_Environment(); AbstractCard tmp_card = new DEBUG_Card("TEST", AbstractCard.CardRarity.Common, AbstractCard.CardType.Attack, AbstractCard.CardTarget.None, 1, "TEST"); int expected_size = 0; //act int actual_size = CardTargettingUtility.GetPCTargets(tmp_card, PC, Monster, (AbstractEnvironment)Environment).Count; //assert Assert.AreEqual(expected_size, actual_size); }
public void DeckHasCardTest_NULLCARD() { //arrange AbstractDeck test_deck = new DEBUG_Deck(); AbstractCard card_one = new DEBUG_Card("Basic:Test1", AbstractCard.CardRarity.Common, AbstractCard.CardType.Attack, AbstractCard.CardTarget.None, 2, "Test card 1"); AbstractCard card_two = new DEBUG_Card("Basic:Test1", AbstractCard.CardRarity.Common, AbstractCard.CardType.Attack, AbstractCard.CardTarget.None, 2, "Test card 1"); AbstractCard card_three = new DEBUG_Card("Basic:Test2", AbstractCard.CardRarity.Rare, AbstractCard.CardType.Magic, AbstractCard.CardTarget.None, 2, "Test card 2"); AbstractCard card_four = new DEBUG_Card("Basic:Test2", AbstractCard.CardRarity.Rare, AbstractCard.CardType.Magic, AbstractCard.CardTarget.None, 2, "Test card 2"); test_deck.AddCard(card_one); test_deck.AddCard(card_two); test_deck.AddCard(card_three); test_deck.AddCard(card_four); AbstractCard serach_card = null; //act DeckSearchUtility.DeckHasCard(serach_card, test_deck); //assert }
public void DeckHasCardTest_NOTFOUND2() { //arrange AbstractDeck test_deck = new DEBUG_Deck(); AbstractCard card_one = new DEBUG_Card("Basic:Test1", AbstractCard.CardRarity.Common, AbstractCard.CardType.Attack, AbstractCard.CardTarget.None, 2, "Test card 1"); AbstractCard card_two = new DEBUG_Card("Basic:Test1", AbstractCard.CardRarity.Common, AbstractCard.CardType.Attack, AbstractCard.CardTarget.None, 2, "Test card 1"); AbstractCard card_three = new DEBUG_Card("Basic:Test2", AbstractCard.CardRarity.Rare, AbstractCard.CardType.Magic, AbstractCard.CardTarget.None, 2, "Test card 2"); AbstractCard card_four = new DEBUG_Card("Basic:Test2", AbstractCard.CardRarity.Rare, AbstractCard.CardType.Magic, AbstractCard.CardTarget.None, 2, "Test card 2"); test_deck.AddCard(card_one); test_deck.AddCard(card_two); test_deck.AddCard(card_three); test_deck.AddCard(card_four); AbstractCard serach_card = new Punch(); bool expected_result = false; //act bool result = DeckSearchUtility.DeckHasCard(serach_card, test_deck); //assert Assert.AreEqual(result, expected_result); }