mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
New Set of Testcases (subclassing for regression and backlog) to force card with no Image and being sure same results apply.
This commit is contained in:
@@ -0,0 +1,44 @@
|
|||||||
|
package forge.card;
|
||||||
|
|
||||||
|
import forge.ImageKeys;
|
||||||
|
import forge.item.PaperCard;
|
||||||
|
import org.mockito.Mockito;
|
||||||
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
|
import org.testng.annotations.BeforeMethod;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
import static org.testng.Assert.assertFalse;
|
||||||
|
import static org.testng.Assert.assertNotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test Case for CardDb forcing No Image for all the cards.
|
||||||
|
* Check that everything still applies the same.
|
||||||
|
*
|
||||||
|
* Note: Run test for the class, being subclass will also run all
|
||||||
|
* other tests as regression.
|
||||||
|
*/
|
||||||
|
public class CardDbTestWithNoImage extends CardDbTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@BeforeMethod
|
||||||
|
public void setup(){
|
||||||
|
super.setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@BeforeMethod
|
||||||
|
protected void initMocks() throws Exception {
|
||||||
|
PowerMockito.mockStatic(ImageKeys.class);
|
||||||
|
PowerMockito.when(ImageKeys.hasImage(Mockito.any(PaperCard.class))).thenReturn(false);
|
||||||
|
super.initMocks();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCardIsReturnedEvenIfThereIsNoImage(){
|
||||||
|
PaperCard shivanDragon = this.cardDb.getCard(cardNameShivanDragon);
|
||||||
|
assertNotNull(shivanDragon);
|
||||||
|
assertFalse(ImageKeys.hasImage(shivanDragon));
|
||||||
|
assertFalse(shivanDragon.hasImage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user